From e217792beda1ca48daea497c00694a3924f992c5 Mon Sep 17 00:00:00 2001 From: Nikolai Merinov Date: Wed, 7 Nov 2018 21:02:27 +0000 Subject: common.opt: Add -Wattribute-warning. * common.opt: Add -Wattribute-warning. * doc/invoke.texi: Add documentation for -Wno-attribute-warning. * expr.c (expand_expr_real_1): Add new attribute to warning_at call to allow user configure behavior of "warning" attribute. * gcc.dg/Wno-attribute-warning.c: New test. From-SVN: r265891 --- gcc/ChangeLog | 7 +++++++ gcc/common.opt | 4 ++++ gcc/doc/invoke.texi | 10 ++++++++++ gcc/expr.c | 3 ++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/Wno-attribute-warning.c | 8 ++++++++ 6 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/Wno-attribute-warning.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d30e60..966f0cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-11-17 Nikolai Merinov + + * common.opt: Add -Wattribute-warning. + * doc/invoke.texi: Add documentation for -Wno-attribute-warning. + * expr.c (expand_expr_real_1): Add new attribute to warning_at + call to allow user configure behavior of "warning" attribute. + 2018-11-07 Segher Boessenkool * target.def: Put @: after every vs., e.g., and i.e. where it is diff --git a/gcc/common.opt b/gcc/common.opt index 2971dc2..5a5d332 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -571,6 +571,10 @@ Wcpp Common Var(warn_cpp) Init(1) Warning Warn when a #warning directive is encountered. +Wattribute-warning +Common Var(warn_attribute_warning) Init(1) Warning +Warn about uses of __attribute__((warning)) declarations. + Wdeprecated-declarations Common Var(warn_deprecated_decl) Init(1) Warning Warn about uses of __attribute__((deprecated)) declarations. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5f67982..cead538 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -292,6 +292,7 @@ Objective-C and Objective-C++ Dialects}. -Wclobbered -Wcomment -Wconditionally-supported @gol -Wconversion -Wcoverage-mismatch -Wno-cpp -Wdangling-else -Wdate-time @gol -Wdelete-incomplete @gol +-Wno-attribute-warning @gol -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol -Wdisabled-optimization @gol -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol @@ -6978,6 +6979,15 @@ confused with the digit 0, and so is not the default, but may be useful as a local coding convention if the programming environment cannot be fixed to display these characters distinctly. +@item -Wno-attribute-warning +@opindex Wno-attribute-warning +@opindex Wattribute-warning +Do not warn about usage of functions (@pxref{Function Attributes}) +declared with @code{warning} attribute. By default, this warning is +enabled. @option{-Wno-attribute-warning} can be used to disable the +warning or @option{-Wno-error=attribute-warning} can be used to +disable the error when compiled with @option{-Werror} flag. + @item -Wno-deprecated @opindex Wno-deprecated @opindex Wdeprecated diff --git a/gcc/expr.c b/gcc/expr.c index 03e5dc4..6341c5a 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -10930,7 +10930,8 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, DECL_ATTRIBUTES (fndecl))) != NULL) { const char *ident = lang_hooks.decl_printable_name (fndecl, 1); - warning_at (tree_nonartificial_location (exp), 0, + warning_at (tree_nonartificial_location (exp), + OPT_Wattribute_warning, "%Kcall to %qs declared with attribute warning: %s", exp, identifier_to_locale (ident), TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr)))); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9bb807e..689d7a7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-11-17 Nikolai Merinov + + * gcc.dg/Wno-attribute-warning.c: New test. + 2018-11-07 Nathan Sidwell PR c++/87904 diff --git a/gcc/testsuite/gcc.dg/Wno-attribute-warning.c b/gcc/testsuite/gcc.dg/Wno-attribute-warning.c new file mode 100644 index 0000000..2475304 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wno-attribute-warning.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-Werror -Wno-error=attribute-warning" } */ + +int f1(void) __attribute__ ((warning("Please avoid f1"))); +int func1(void) +{ + return f1(); /* { dg-warning "'f1' declared with attribute warning: Please avoid f1" } */ +} -- cgit v1.1 From c2ca29d5a35f8dd62f76df48e16bbac7320660c8 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Wed, 7 Nov 2018 22:06:26 +0000 Subject: re PR c/87691 (transparent_union attribute does not work with MODE_PARTIAL_INT) 2018-11-07 Jozef Lawrynowicz PR c/87691 gcc/ChangeLog: * stor-layout.c (compute_record_mode): Set TYPE_MODE of UNION_TYPE to the mode of the widest field iff the widest field has mode class MODE_INT, or MODE_PARTIAL_INT and the union would be passed by reference. gcc/testsuite/ChangeLog: * gcc.target/msp430/pr87691.c: New test. From-SVN: r265894 --- gcc/ChangeLog | 18 ++++++++++---- gcc/stor-layout.c | 21 +++++++++++++--- gcc/testsuite/ChangeLog | 9 +++++-- gcc/testsuite/gcc.target/msp430/pr87691.c | 41 +++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.target/msp430/pr87691.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 966f0cb..c1eef4c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,9 +1,17 @@ -2018-11-17 Nikolai Merinov +2018-11-07 Jozef Lawrynowicz - * common.opt: Add -Wattribute-warning. - * doc/invoke.texi: Add documentation for -Wno-attribute-warning. - * expr.c (expand_expr_real_1): Add new attribute to warning_at - call to allow user configure behavior of "warning" attribute. + PR c/87691 + * stor-layout.c (compute_record_mode): Set TYPE_MODE of UNION_TYPE + to the mode of the widest field iff the widest field has mode class + MODE_INT, or MODE_PARTIAL_INT and the union would be passed by + reference. + +2018-11-07 Nikolai Merinov + + * common.opt: Add -Wattribute-warning. + * doc/invoke.texi: Add documentation for -Wno-attribute-warning. + * expr.c (expand_expr_real_1): Add new attribute to warning_at + call to allow user configure behavior of "warning" attribute. 2018-11-07 Segher Boessenkool diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 42df257..4f32317 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1834,7 +1834,13 @@ compute_record_mode (tree type) /* If this field is the whole struct, remember its mode so that, say, we can put a double in a class into a DF register instead of forcing it to live in the stack. */ - if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field))) + if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field)) + /* Partial int types (e.g. __int20) may have TYPE_SIZE equal to + wider types (e.g. int32), despite precision being less. Ensure + that the TYPE_MODE of the struct does not get set to the partial + int mode if there is a wider type also in the struct. */ + && known_gt (GET_MODE_PRECISION (DECL_MODE (field)), + GET_MODE_PRECISION (mode))) mode = DECL_MODE (field); /* With some targets, it is sub-optimal to access an aligned @@ -1844,10 +1850,17 @@ compute_record_mode (tree type) } /* If we only have one real field; use its mode if that mode's size - matches the type's size. This only applies to RECORD_TYPE. This - does not apply to unions. */ + matches the type's size. This generally only applies to RECORD_TYPE. + For UNION_TYPE, if the widest field is MODE_INT then use that mode. + If the widest field is MODE_PARTIAL_INT, and the union will be passed + by reference, then use that mode. */ poly_uint64 type_size; - if (TREE_CODE (type) == RECORD_TYPE + if ((TREE_CODE (type) == RECORD_TYPE + || (TREE_CODE (type) == UNION_TYPE + && (GET_MODE_CLASS (mode) == MODE_INT + || (GET_MODE_CLASS (mode) == MODE_PARTIAL_INT + && targetm.calls.pass_by_reference (pack_cumulative_args (0), + mode, type, 0))))) && mode != VOIDmode && poly_int_tree_p (TYPE_SIZE (type), &type_size) && known_eq (GET_MODE_BITSIZE (mode), type_size)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 689d7a7..51f1b60 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ -2018-11-17 Nikolai Merinov +2018-11-07 Jozef Lawrynowicz - * gcc.dg/Wno-attribute-warning.c: New test. + PR c/87691 + * gcc.target/msp430/pr87691.c: New test. + +2018-11-07 Nikolai Merinov + + * gcc.dg/Wno-attribute-warning.c: New test. 2018-11-07 Nathan Sidwell diff --git a/gcc/testsuite/gcc.target/msp430/pr87691.c b/gcc/testsuite/gcc.target/msp430/pr87691.c new file mode 100644 index 0000000..c00425d --- /dev/null +++ b/gcc/testsuite/gcc.target/msp430/pr87691.c @@ -0,0 +1,41 @@ +/* PR 87691 - Test that a union containing __int20 and a float is not treated as + 20-bits in size. */ + +/* { dg-do compile } */ +/* { dg-skip-if "no __int20 for mcpu=msp430" { *-*-* } { "-mcpu=msp430" } { "" } } */ +/* { dg-final { scan-assembler-not "MOVX.A" } } */ + +/* To move a 20-bit value from memory (using indexed or indirect register + mode), onto the stack (also addressed using indexed or indirect register + mode), MOVX.A must be used. MOVA does not support these addressing modes. + Therefore, to check that the union is not manipulated as a 20-bit type, + test that no MOVX.A instructions are present in the assembly. + + MOVA is used to fill/spill u.i, but if the union is treated as 20 bits in + size, MOVX.A would be used. No other __int20 operations are present + in the source, so there will be no valid uses of MOVX.A in the resulting + assembly. */ + +union U1 +{ + float f; + __int20 i; +}; + +union U2 +{ + __int20 i; + float f; +}; + +float foo1 (union U1 u) +{ + u.i += 42; + return u.f; +} + +float foo2 (union U2 u) +{ + u.i += 42; + return u.f; +} -- cgit v1.1 From 48b2caf016f12c48ca43024c45d080b5333a1ca9 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Wed, 7 Nov 2018 22:26:16 +0000 Subject: pr65595.c: Change type of "num" argument to memcpy from "unsigned long" to __SIZE_TYPE__. 2018-11-07 Jozef Lawrynowicz * gcc.c-torture/compile/pr65595.c: Change type of "num" argument to memcpy from "unsigned long" to __SIZE_TYPE__. From-SVN: r265895 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr65595.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51f1b60..5685661 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-11-07 Jozef Lawrynowicz + * gcc.c-torture/compile/pr65595.c: Change type of "num" argument to + memcpy from "unsigned long" to __SIZE_TYPE__. + +2018-11-07 Jozef Lawrynowicz + PR c/87691 * gcc.target/msp430/pr87691.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr65595.c b/gcc/testsuite/gcc.c-torture/compile/pr65595.c index 0ab7161..b6a0aa4 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr65595.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr65595.c @@ -1,4 +1,4 @@ -extern void *memcpy(void *, const void *, unsigned long); +extern void *memcpy(void *, const void *, __SIZE_TYPE__); struct in6_addr { struct { int u6_addr32[4]; -- cgit v1.1 From e9f3803db32c8dd499fe9da64558d30f6a920cc9 Mon Sep 17 00:00:00 2001 From: Hafiz Abid Qadeer Date: Wed, 7 Nov 2018 22:41:21 +0000 Subject: iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-06 Hafiz Abid Qadeer * config/iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. Append $INCICONV to it. gcc/ * configure: Regenerated. libcpp/ * configure: Likewise. libstdc++-v3/ * configure: Likewise. intl/ * configure: Likewise. From-SVN: r265896 --- ChangeLog | 5 +++++ config/iconv.m4 | 2 +- gcc/ChangeLog | 4 ++++ gcc/configure | 2 +- intl/ChangeLog | 4 ++++ intl/configure | 2 +- libcpp/ChangeLog | 4 ++++ libcpp/configure | 2 +- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/configure | 8 ++++---- 10 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d93178..e066279 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-11-06 Hafiz Abid Qadeer + + * config/iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. + Append $INCICONV to it. + 2018-11-04 Stafford Horne * MAINTAINERS (Write After Approval): Add myself. diff --git a/config/iconv.m4 b/config/iconv.m4 index 5f9304a..f1e54c5 100644 --- a/config/iconv.m4 +++ b/config/iconv.m4 @@ -73,7 +73,7 @@ AC_DEFUN([AM_ICONV_LINK], if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c1eef4c..8efe5fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-11-07 Hafiz Abid Qadeer + + * configure: Regenerated. + 2018-11-07 Jozef Lawrynowicz PR c/87691 diff --git a/gcc/configure b/gcc/configure index a24221d..b814484 100755 --- a/gcc/configure +++ b/gcc/configure @@ -10833,7 +10833,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/intl/ChangeLog b/intl/ChangeLog index f4ae3e5..8c93696 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,7 @@ +2018-11-07 Hafiz Abid Qadeer + + * configure: Regenerated. + 2018-10-31 Joseph Myers PR bootstrap/82856 diff --git a/intl/configure b/intl/configure index 5881cff..2f35993 100755 --- a/intl/configure +++ b/intl/configure @@ -5639,7 +5639,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 4f28047..a3d3dd6 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,7 @@ +2018-11-07 Hafiz Abid Qadeer + + * configure: Regenerated. + 2018-11-05 Martin Liska * symtab.c (ht_dump_statistics): Replace %zu with %lu format. diff --git a/libcpp/configure b/libcpp/configure index 2e98fd1..a7aa35c 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -7165,7 +7165,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index bdff031..11cceda 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2018-11-07 Hafiz Abid Qadeer + + * configure: Regenerated. + 2018-11-07 Jonathan Wakely * config/abi/pre/gnu.ver: Fix patterns for size_t parameters. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 3462059..39f83e2 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -28980,7 +28980,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" if test x$gcc_no_link = xyes; then as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 @@ -41274,7 +41274,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" if test x$gcc_no_link = xyes; then as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 @@ -47392,7 +47392,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" if test x$gcc_no_link = xyes; then as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 @@ -60238,7 +60238,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test "$am_cv_func_iconv" != yes; then am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" - CPPFLAGS="$LIBS $INCICONV" + CPPFLAGS="$CPPFLAGS $INCICONV" LIBS="$LIBS $LIBICONV" if test x$gcc_no_link = xyes; then as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -- cgit v1.1 From 05da2a5c39a4c94e176c1fbf1e268646eb2d83cd Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 7 Nov 2018 22:50:20 +0000 Subject: [PR/87936] --disable-checking bootstrap break https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00502.html PR 87926 * Makefile.in (bitmap.o-warn): Add -Wno-error to unbreak --disable-checking bootstrap. From-SVN: r265899 --- gcc/ChangeLog | 6 ++++++ gcc/Makefile.in | 1 + 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8efe5fa..2210a2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-07 Nathan Sidwell + + PR 87926 + * Makefile.in (bitmap.o-warn): Add -Wno-error to unbreak + --disable-checking bootstrap. + 2018-11-07 Hafiz Abid Qadeer * configure: Regenerated. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 719a516..6130554 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -221,6 +221,7 @@ libgcov-merge-tool.o-warn = -Wno-error gimple-match.o-warn = -Wno-unused generic-match.o-warn = -Wno-unused dfp.o-warn = -Wno-strict-aliasing +bitmap.o-warn = -Wno-error # PR 87926 # All warnings have to be shut off in stage1 if the compiler used then # isn't gcc; configure determines that. WARN_CFLAGS will be either -- cgit v1.1 From 354b4b6a0d36ce98ba4b7ab926ea56e98b3c4bf5 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 8 Nov 2018 00:16:47 +0000 Subject: Daily bump. From-SVN: r265902 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index dccc962..6277b96 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20181107 +20181108 -- cgit v1.1 From 24d9c62fda5af945366c9d416faa0f27cbe37eb6 Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Wed, 7 Nov 2018 20:26:28 -0500 Subject: re PR driver/80828 (Command line option -e not documented) 2018-11-07 Sandra Loosemore PR driver/80828 gcc/ * doc/invoke.texi (Option Summary): Add -e and --entry. (Link Options): Likewise. From-SVN: r265903 --- gcc/ChangeLog | 6 ++++++ gcc/doc/invoke.texi | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2210a2b..2ca7939 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-07 Sandra Loosemore + + PR driver/80828 + * doc/invoke.texi (Option Summary): Add -e and --entry. + (Link Options): Likewise. + 2018-11-07 Nathan Sidwell PR 87926 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index cead538..df4955c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -524,6 +524,7 @@ Objective-C and Objective-C++ Dialects}. @xref{Link Options,,Options for Linking}. @gccoptlist{@var{object-file-name} -fuse-ld=@var{linker} -l@var{library} @gol -nostartfiles -nodefaultlibs -nolibc -nostdlib @gol +-e @var{entry} --entry=@var{entry} @gol -pie -pthread -r -rdynamic @gol -s -static -static-pie -static-libgcc -static-libstdc++ @gol -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol @@ -12712,6 +12713,15 @@ library subroutines. constructors are called; @pxref{Collect2,,@code{collect2}, gccint, GNU Compiler Collection (GCC) Internals}.) +@item -e @var{entry} +@itemx --entry=@var{entry} +@opindex e +@opindex entry + +Specify that the program entry point is @var{entry}. The argument is +interpreted by the linker; the GNU linker accepts either a symbol name +or an address. + @item -pie @opindex pie Produce a dynamically linked position independent executable on targets -- cgit v1.1 From a28102f8cc84d0ea340ce7cf71bb45ad6f354927 Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Wed, 7 Nov 2018 21:46:09 -0500 Subject: invoke.texi: Remove leading dash from @opindex entries throughout the file. 2018-11-07 Sandra Loosemore gcc/ * doc/invoke.texi: Remove leading dash from @opindex entries throughout the file. From-SVN: r265904 --- gcc/ChangeLog | 5 +++++ gcc/doc/invoke.texi | 42 +++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ca7939..a85868c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-11-07 Sandra Loosemore + * doc/invoke.texi: Remove leading dash from @opindex entries + throughout the file. + +2018-11-07 Sandra Loosemore + PR driver/80828 * doc/invoke.texi (Option Summary): Add -e and --entry. (Link Options): Likewise. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index df4955c..e455b91 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2934,7 +2934,7 @@ union U @{ @item -Wabi-tag @r{(C++ and Objective-C++ only)} @opindex Wabi-tag -@opindex -Wabi-tag +@opindex Wabi-tag Warn when a type with an ABI tag is used in a context that does not have that ABI tag. See @ref{C++ Attributes} for more information about ABI tags. @@ -3845,7 +3845,7 @@ a left margin is printed, showing line numbers. This option suppresses this left margin. @item -fdiagnostics-minimum-margin-width=@var{width} -@opindex -fdiagnostics-minimum-margin-width +@opindex fdiagnostics-minimum-margin-width This option controls the minimum width of the left margin printed by @option{-fdiagnostics-show-line-numbers}. It defaults to 6. @@ -5734,8 +5734,8 @@ larger. This option warns on all uses of @code{alloca} in the source. @item -Walloca-larger-than=@var{byte-size} -@opindex -Walloca-larger-than= -@opindex -Wno-alloca-larger-than +@opindex Walloca-larger-than= +@opindex Wno-alloca-larger-than This option warns on calls to @code{alloca} with an integer argument whose value is either zero, or that is not bounded by a controlling predicate that limits its value to at most @var{byte-size}. It also warns for calls @@ -6661,8 +6661,8 @@ real to lower precision real values. This option is also enabled by @option{-Wconversion}. @item -Wno-scalar-storage-order -@opindex -Wno-scalar-storage-order -@opindex -Wscalar-storage-order +@opindex Wno-scalar-storage-order +@opindex Wscalar-storage-order Do not warn on suspicious constructs involving reverse scalar storage order. @item -Wsized-deallocation @r{(C++ and Objective-C++ only)} @@ -7263,8 +7263,8 @@ Warn if a variable-length array is used in the code. the variable-length array. @item -Wvla-larger-than=@var{byte-size} -@opindex -Wvla-larger-than= -@opindex -Wno-vla-larger-than +@opindex Wvla-larger-than= +@opindex Wno-vla-larger-than If this option is used, the compiler will warn for declarations of variable-length arrays whose size is either unbounded, or bounded by an argument that allows the array size to exceed @var{byte-size} @@ -8942,13 +8942,13 @@ it may significantly increase code size This flag is enabled by default at @option{-O3}. @item -fipa-bit-cp -@opindex -fipa-bit-cp +@opindex fipa-bit-cp When enabled, perform interprocedural bitwise constant propagation. This flag is enabled by default at @option{-O2}. It requires that @option{-fipa-cp} is enabled. @item -fipa-vrp -@opindex -fipa-vrp +@opindex fipa-vrp When enabled, perform interprocedural propagation of value ranges. This flag is enabled by default at @option{-O2}. It requires that @option{-fipa-cp} is enabled. @@ -12559,7 +12559,7 @@ object file names should not be used as arguments. @xref{Overall Options}. @item -flinker-output=@var{type} -@opindex -flinker-output +@opindex flinker-output This option controls the code generation of the link time optimizer. By default the linker output is determined by the linker plugin automatically. For debugging the compiler and in the case of incremental linking to non-lto object @@ -15105,8 +15105,8 @@ single precision and to 32 bits for double precision. @item -mlow-precision-sqrt @itemx -mno-low-precision-sqrt -@opindex -mlow-precision-sqrt -@opindex -mno-low-precision-sqrt +@opindex mlow-precision-sqrt +@opindex mno-low-precision-sqrt Enable or disable the square root approximation. This option only has an effect if @option{-ffast-math} or @option{-funsafe-math-optimizations} is used as well. Enabling this reduces @@ -15116,8 +15116,8 @@ If enabled, it implies @option{-mlow-precision-recip-sqrt}. @item -mlow-precision-div @itemx -mno-low-precision-div -@opindex -mlow-precision-div -@opindex -mno-low-precision-div +@opindex mlow-precision-div +@opindex mno-low-precision-div Enable or disable the division approximation. This option only has an effect if @option{-ffast-math} or @option{-funsafe-math-optimizations} is used as well. Enabling this reduces @@ -18109,11 +18109,11 @@ Specify the C-SKY target processor. Valid values for @var{cpu} are: @item -mbig-endian @opindex mbig-endian @itemx -EB -@opindex -EB +@opindex EB @itemx -mlittle-endian @opindex mlittle-endian @itemx -EL -@opindex -EL +@opindex EL Select big- or little-endian code. The default is little-endian. @@ -27950,7 +27950,7 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}. @opindex mvaes @need 200 @itemx -mwaitpkg -@opindex -mwaitpkg +@opindex mwaitpkg @need 200 @itemx -mvpclmulqdq @opindex mvpclmulqdq @@ -28536,7 +28536,7 @@ prevents the compiler from using floating-point, vector, mask and bound registers. @item -mindirect-branch=@var{choice} -@opindex -mindirect-branch +@opindex mindirect-branch Convert indirect call and jump with @var{choice}. The default is @samp{keep}, which keeps indirect call and jump unmodified. @samp{thunk} converts indirect call and jump to call and return thunk. @@ -28556,7 +28556,7 @@ Note that @option{-mindirect-branch=thunk-extern} is incompatible with to disable control-flow check. @item -mfunction-return=@var{choice} -@opindex -mfunction-return +@opindex mfunction-return Convert function return with @var{choice}. The default is @samp{keep}, which keeps function return unmodified. @samp{thunk} converts function return to call and return thunk. @samp{thunk-inline} converts function @@ -28573,7 +28573,7 @@ not be reachable in the large code model. @item -mindirect-branch-register -@opindex -mindirect-branch-register +@opindex mindirect-branch-register Force indirect call and jump via register. @end table -- cgit v1.1 From bd21ffae02ebf96a8c120278d7e9f7ce46f4483f Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Wed, 7 Nov 2018 22:37:32 -0500 Subject: re PR middle-end/42726 (-fno-common documentation inaccuracy) 2018-11-07 Sandra Loosemore PR middle-end/42726 gcc/ * doc/invoke.texi (Code Gen Options): Clarify -fno-common behavior. From-SVN: r265906 --- gcc/ChangeLog | 5 +++++ gcc/doc/invoke.texi | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a85868c..decc5a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-11-07 Sandra Loosemore + PR middle-end/42726 + * doc/invoke.texi (Code Gen Options): Clarify -fno-common behavior. + +2018-11-07 Sandra Loosemore + * doc/invoke.texi: Remove leading dash from @opindex entries throughout the file. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index e455b91..849bb76 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -13294,7 +13294,7 @@ C, and on some targets may carry a speed or code size penalty on variable references. The @option{-fno-common} option specifies that the compiler should instead -place uninitialized global variables in the data section of the object file. +place uninitialized global variables in the BSS section of the object file. This inhibits the merging of tentative definitions by the linker so you get a multiple-definition error if the same variable is defined in more than one compilation unit. -- cgit v1.1 From ab6813850d0a51f90f57a0e4da470cb0b5c5b1f3 Mon Sep 17 00:00:00 2001 From: Chenghua Xu Date: Thu, 8 Nov 2018 07:45:22 +0000 Subject: Add mips option dependency only config with loongson target. gcc/testsuite/ * gcc.target/mips/mips.exp (mips-dg-options): Add mips_option_dependency msoft-float vs no-mmi and mips16/micromips vs no-mmi/ext/ext2 only gcc config with Loongson target. From-SVN: r265908 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.target/mips/mips.exp | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5685661..e719c31 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-11-08 Chenghua Xu + + * gcc.target/mips/mips.exp (mips-dg-options): + Add mips_option_dependency msoft-float vs no-mmi and + mips16/micromips vs no-mmi/ext/ext2 only gcc + config with Loongson target. + 2018-11-07 Jozef Lawrynowicz * gcc.c-torture/compile/pr65595.c: Change type of "num" argument to diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp index e70d416..002cc28 100644 --- a/gcc/testsuite/gcc.target/mips/mips.exp +++ b/gcc/testsuite/gcc.target/mips/mips.exp @@ -1054,10 +1054,19 @@ proc mips-dg-options { args } { mips_option_dependency options "-mno-plt" "addressing=unknown" mips_option_dependency options "-mabicalls" "-G0" mips_option_dependency options "-mno-gpopt" "-mexplicit-relocs" - mips_option_dependency options "-mips16" "-mno-loongson-mmi" - mips_option_dependency options "-mmicromips" "-mno-loongson-mmi" - mips_option_dependency options "-msoft-float" "-mno-loongson-mmi" - mips_option_dependency options "-mmicromips" "-mno-loongson-ext" + + if { [check_configured_with "with-arch=loongson3a"] + || [check_configured_with "with-arch=gs464"] + || [check_configured_with "with-arch=gs464e"] + || [check_configured_with "with-arch=gs264e"] } { + mips_option_dependency options "-msoft-float" "-mno-loongson-mmi" + mips_option_dependency options "-mips16" "-mno-loongson-mmi" + mips_option_dependency options "-mips16" "-mno-loongson-ext" + mips_option_dependency options "-mips16" "-mno-loongson-ext2" + mips_option_dependency options "-mmicromips" "-mno-loongson-mmi" + mips_option_dependency options "-mmicromips" "-mno-loongson-ext" + mips_option_dependency options "-mmicromips" "-mno-loongson-ext2" + } # Work out information about the current ABI. set abi_test_option_p [mips_test_option_p options abi] -- cgit v1.1 From 85eaf6c6a3678d7eb19552a8a6f58018e6892115 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 8 Nov 2018 08:03:12 +0000 Subject: re PR target/87913 (max(n, 1) code generation) 2018-11-08 Richard Biener PR tree-optimization/87913 * tree-ssa-phiopt.c (minmax_replacement): Turn EQ/NE compares of extreme values to ordered comparisons. * gcc.dg/tree-ssa/phi-opt-20.c: New testcase. From-SVN: r265909 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/phi-opt-20.c | 25 +++++++++++++++++++++++++ gcc/tree-ssa-phiopt.c | 25 ++++++++++++++++++++++--- 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-20.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index decc5a0..270180f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-08 Richard Biener + + PR tree-optimization/87913 + * tree-ssa-phiopt.c (minmax_replacement): Turn EQ/NE compares + of extreme values to ordered comparisons. + 2018-11-07 Sandra Loosemore PR middle-end/42726 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e719c31..5edc17e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Richard Biener + + PR tree-optimization/87913 + * gcc.dg/tree-ssa/phi-opt-20.c: New testcase. + 2018-11-08 Chenghua Xu * gcc.target/mips/mips.exp (mips-dg-options): diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-20.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-20.c new file mode 100644 index 0000000..c310308 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-20.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-phiopt1" } */ + +unsigned int f(unsigned int num) +{ + return num < 1 ? 1 : num; +} + +unsigned int g(unsigned int num) +{ + return num > (unsigned)__INT_MAX__ * 2 ? (unsigned)__INT_MAX__ * 2 : num; +} + +int h(int num) +{ + return num < -__INT_MAX__ ? -__INT_MAX__ : num; +} + +int i(int num) +{ + return num > __INT_MAX__-1 ? __INT_MAX__-1 : num; +} + +/* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "phiopt1" } } */ +/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "phiopt1" } } */ diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 0784510..64039e2 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -1204,7 +1204,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, edge e0, edge e1, gimple *phi, tree arg0, tree arg1) { - tree result, type; + tree result, type, rhs; gcond *cond; gassign *new_stmt; edge true_edge, false_edge; @@ -1220,6 +1220,25 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, cond = as_a (last_stmt (cond_bb)); cmp = gimple_cond_code (cond); + rhs = gimple_cond_rhs (cond); + + /* Turn EQ/NE of extreme values to order comparisons. */ + if ((cmp == NE_EXPR || cmp == EQ_EXPR) + && TREE_CODE (rhs) == INTEGER_CST) + { + if (wi::eq_p (wi::to_wide (rhs), wi::min_value (TREE_TYPE (rhs)))) + { + cmp = (cmp == EQ_EXPR) ? LT_EXPR : GE_EXPR; + rhs = wide_int_to_tree (TREE_TYPE (rhs), + wi::min_value (TREE_TYPE (rhs)) + 1); + } + else if (wi::eq_p (wi::to_wide (rhs), wi::max_value (TREE_TYPE (rhs)))) + { + cmp = (cmp == EQ_EXPR) ? GT_EXPR : LE_EXPR; + rhs = wide_int_to_tree (TREE_TYPE (rhs), + wi::max_value (TREE_TYPE (rhs)) - 1); + } + } /* This transformation is only valid for order comparisons. Record which operand is smaller/larger if the result of the comparison is true. */ @@ -1228,7 +1247,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, if (cmp == LT_EXPR || cmp == LE_EXPR) { smaller = gimple_cond_lhs (cond); - larger = gimple_cond_rhs (cond); + larger = rhs; /* If we have smaller < CST it is equivalent to smaller <= CST-1. Likewise smaller <= CST is equivalent to smaller < CST+1. */ if (TREE_CODE (larger) == INTEGER_CST) @@ -1255,7 +1274,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, } else if (cmp == GT_EXPR || cmp == GE_EXPR) { - smaller = gimple_cond_rhs (cond); + smaller = rhs; larger = gimple_cond_lhs (cond); /* If we have larger > CST it is equivalent to larger >= CST+1. Likewise larger >= CST is equivalent to larger > CST-1. */ -- cgit v1.1 From f1f5b884c8d7a3360e0c46a9cb3c383af1d7b883 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Thu, 8 Nov 2018 08:45:58 +0000 Subject: Don't use predefined sun in g++.dg/lto/pr87906 * g++.dg/lto/pr87906_0.C: Use moon instead of possibly predefined sun. * g++.dg/lto/pr87906_1.C: Likewise. From-SVN: r265910 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/lto/pr87906_0.C | 10 +++++----- gcc/testsuite/g++.dg/lto/pr87906_1.C | 8 ++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5edc17e..3584dfb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-11-08 Rainer Orth + + * g++.dg/lto/pr87906_0.C: Use moon instead of possibly predefined + sun. + * g++.dg/lto/pr87906_1.C: Likewise. + 2018-11-08 Richard Biener PR tree-optimization/87913 diff --git a/gcc/testsuite/g++.dg/lto/pr87906_0.C b/gcc/testsuite/g++.dg/lto/pr87906_0.C index 08e7ed3..31b62da 100644 --- a/gcc/testsuite/g++.dg/lto/pr87906_0.C +++ b/gcc/testsuite/g++.dg/lto/pr87906_0.C @@ -3,13 +3,13 @@ // { dg-extra-ld-options "-shared -nostdlib" } namespace com { -namespace sun { +namespace moon { namespace star {} -} // namespace sun +} // namespace moon } // namespace com -namespace a = com::sun::star; +namespace a = com::moon::star; namespace com { -namespace sun { +namespace moon { namespace star { namespace uno { class a { @@ -28,7 +28,7 @@ class c { class RuntimeException : b {}; } // namespace uno } // namespace star -} // namespace sun +} // namespace moon } // namespace com template void d(int) { throw a::uno::RuntimeException(); } int f; diff --git a/gcc/testsuite/g++.dg/lto/pr87906_1.C b/gcc/testsuite/g++.dg/lto/pr87906_1.C index ee5849f..5610876 100644 --- a/gcc/testsuite/g++.dg/lto/pr87906_1.C +++ b/gcc/testsuite/g++.dg/lto/pr87906_1.C @@ -1,5 +1,5 @@ namespace com { -namespace sun { +namespace moon { namespace star { namespace uno { class a { @@ -15,9 +15,9 @@ class RuntimeException : b {}; } // namespace uno class C : uno::RuntimeException {}; } // namespace star -} // namespace sun +} // namespace moon } // namespace com -using com::sun::star::C; -using com::sun::star::uno::RuntimeException; +using com::moon::star::C; +using com::moon::star::uno::RuntimeException; void d() { throw RuntimeException(); } void e() { C(); } -- cgit v1.1 From c4e7e1b9f74bb6688bc9e9f3454bc45b890d4a9d Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 8 Nov 2018 09:50:49 +0100 Subject: Change wording of __builtin_expect_with_probability errors. 2018-11-08 Martin Liska * doc/extend.texi: Reword. * predict.c (expr_expected_value_1): Likewise. 2018-11-08 Martin Liska * gcc.dg/pr87811.c: Update scanned pattern. * gcc.dg/pr87811-2.c: Likewise. From-SVN: r265911 --- gcc/ChangeLog | 5 +++++ gcc/doc/extend.texi | 2 +- gcc/predict.c | 8 ++++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr87811-2.c | 2 +- gcc/testsuite/gcc.dg/pr87811.c | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 270180f..145195c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Martin Liska + + * doc/extend.texi: Reword. + * predict.c (expr_expected_value_1): Likewise. + 2018-11-08 Richard Biener PR tree-optimization/87913 diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 8de92da..dc8fc6e 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12047,7 +12047,7 @@ This function has the same semantics as @code{__builtin_expect}, but the caller provides the expected probability that @var{exp} == @var{c}. The last argument, @var{probability}, is a floating-point value in the range 0.0 to 1.0, inclusive. The @var{probability} argument must be -a compiler time constant. +constant floating-point expression. @end deftypefn @deftypefn {Built-in Function} void __builtin_trap (void) diff --git a/gcc/predict.c b/gcc/predict.c index 80a8d68..8482737 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -2470,8 +2470,8 @@ expr_expected_value_1 (tree type, tree op0, enum tree_code code, if (TREE_CODE (r) != REAL_CST) { error_at (gimple_location (def), - "probability argument %qE must be a compile " - "time constant", prob); + "probability %qE must be " + "constant floating-point expression", prob); return NULL; } HOST_WIDE_INT probi @@ -2483,8 +2483,8 @@ expr_expected_value_1 (tree type, tree op0, enum tree_code code, } else error_at (gimple_location (def), - "probability argument %qE must be a in the " - "range 0.0 to 1.0", prob); + "probability %qE is outside " + "the range [0.0, 1.0]", prob); return gimple_call_arg (def, 1); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3584dfb..773fcce 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Martin Liska + + * gcc.dg/pr87811.c: Update scanned pattern. + * gcc.dg/pr87811-2.c: Likewise. + 2018-11-08 Rainer Orth * g++.dg/lto/pr87906_0.C: Use moon instead of possibly predefined diff --git a/gcc/testsuite/gcc.dg/pr87811-2.c b/gcc/testsuite/gcc.dg/pr87811-2.c index aa30ddf..8b08187 100644 --- a/gcc/testsuite/gcc.dg/pr87811-2.c +++ b/gcc/testsuite/gcc.dg/pr87811-2.c @@ -6,7 +6,7 @@ void bar (void); void foo (int i) { - if (__builtin_expect_with_probability (i, 0, 2.0f)) /* { dg-error "probability argument .* must be a in the range 0\\\.0 to 1\\\.0" } */ + if (__builtin_expect_with_probability (i, 0, 2.0f)) /* { dg-error "probability .* is outside the range \\\[0\\\.0, 1\\\.0\\\]" } */ bar (); } diff --git a/gcc/testsuite/gcc.dg/pr87811.c b/gcc/testsuite/gcc.dg/pr87811.c index 9045c8e..110b383 100644 --- a/gcc/testsuite/gcc.dg/pr87811.c +++ b/gcc/testsuite/gcc.dg/pr87811.c @@ -6,7 +6,7 @@ void bar (void); void foo (int i, double d) { - if (__builtin_expect_with_probability (i, 0, d)) /* { dg-error "probability argument .d. must be a compile time constant" } */ + if (__builtin_expect_with_probability (i, 0, d)) /* { dg-error "probability .d. must be constant floating-point expression" } */ bar (); } -- cgit v1.1 From fd5c4c4c99f82fe702f4b4cc5fc2d64f461fc639 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 8 Nov 2018 10:47:59 +0000 Subject: re PR tree-optimization/87929 (ICE in verify_gimple failed) 2018-11-08 Richard Biener PR tree-optimization/87929 * tree-complex.c (expand_complex_comparison): Clean EH. * gcc.dg/pr87929.c: New testcase. From-SVN: r265912 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr87929.c | 16 ++++++++++++++++ gcc/tree-complex.c | 2 ++ 4 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr87929.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 145195c..b1a33a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Richard Biener + + PR tree-optimization/87929 + * tree-complex.c (expand_complex_comparison): Clean EH. + 2018-11-08 Martin Liska * doc/extend.texi: Reword. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 773fcce..f6c36f3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Richard Biener + + PR tree-optimization/87929 + * gcc.dg/pr87929.c: New testcase. + 2018-11-08 Martin Liska * gcc.dg/pr87811.c: Update scanned pattern. diff --git a/gcc/testsuite/gcc.dg/pr87929.c b/gcc/testsuite/gcc.dg/pr87929.c new file mode 100644 index 0000000..f64f7ad --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr87929.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-fexceptions -fnon-call-exceptions -fsignaling-nans" } */ + +#define complex __complex__ +#define _Complex_I (1.0iF) + +extern void f2c_4d__( complex float *, complex float *); +extern void abort (void); + +void f2c_4c__(void) +{ + complex float x,ret_val; + x = 1234 + 5678 * _Complex_I; + f2c_4d__(&ret_val,&x); + if ( x != ret_val ) abort(); +} diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index 4908808..4bf644f 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -1558,6 +1558,8 @@ expand_complex_comparison (gimple_stmt_iterator *gsi, tree ar, tree ai, } update_stmt (stmt); + if (maybe_clean_eh_stmt (stmt)) + gimple_purge_dead_eh_edges (gimple_bb (stmt)); } /* Expand inline asm that sets some complex SSA_NAMEs. */ -- cgit v1.1 From 1c8badf66bec4e0ff73ae24bf4f8cabbef8c137a Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 8 Nov 2018 12:15:49 +0000 Subject: tree-data-ref.h (lambda_int): New typedef. 2018-11-08 Richard Biener * tree-data-ref.h (lambda_int): New typedef. (lambda_vector_gcd): Adjust. (lambda_vector_new): Likewise. (lambda_matrix_new): Likewise. * tree-data-ref.c (print_lambda_vector): Adjust. From-SVN: r265914 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-data-ref.c | 2 +- gcc/tree-data-ref.h | 11 ++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1a33a1..4af240a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2018-11-08 Richard Biener + * tree-data-ref.h (lambda_int): New typedef. + (lambda_vector_gcd): Adjust. + (lambda_vector_new): Likewise. + (lambda_matrix_new): Likewise. + * tree-data-ref.c (print_lambda_vector): Adjust. + +2018-11-08 Richard Biener + PR tree-optimization/87929 * tree-complex.c (expand_complex_comparison): Clean EH. diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 66e780d..6019c61 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -393,7 +393,7 @@ print_lambda_vector (FILE * outfile, lambda_vector vector, int n) int i; for (i = 0; i < n; i++) - fprintf (outfile, "%3d ", vector[i]); + fprintf (outfile, "%3d ", (int)vector[i]); fprintf (outfile, "\n"); } diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h index 525d27f..439a8b9 100644 --- a/gcc/tree-data-ref.h +++ b/gcc/tree-data-ref.h @@ -138,7 +138,8 @@ struct dr_alias space. A vector space is a set that is closed under vector addition and scalar multiplication. In this vector space, an element is a list of integers. */ -typedef int *lambda_vector; +typedef HOST_WIDE_INT lambda_int; +typedef lambda_int *lambda_vector; /* An integer matrix. A matrix consists of m vectors of length n (IE all vectors are the same length). */ @@ -611,11 +612,11 @@ void split_constant_offset (tree , tree *, tree *); /* Compute the greatest common divisor of a VECTOR of SIZE numbers. */ -static inline int +static inline lambda_int lambda_vector_gcd (lambda_vector vector, int size) { int i; - int gcd1 = 0; + lambda_int gcd1 = 0; if (size > 0) { @@ -632,7 +633,7 @@ static inline lambda_vector lambda_vector_new (int size) { /* ??? We shouldn't abuse the GC allocator here. */ - return ggc_cleared_vec_alloc (size); + return ggc_cleared_vec_alloc (size); } /* Clear out vector VEC1 of length SIZE. */ @@ -686,7 +687,7 @@ lambda_matrix_new (int m, int n, struct obstack *lambda_obstack) mat = XOBNEWVEC (lambda_obstack, lambda_vector, m); for (i = 0; i < m; i++) - mat[i] = XOBNEWVEC (lambda_obstack, int, n); + mat[i] = XOBNEWVEC (lambda_obstack, lambda_int, n); return mat; } -- cgit v1.1 From 212755ff9137bcd3975e02f4936c96bdb7eaf709 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 8 Nov 2018 14:55:54 +0000 Subject: cgraph: add selftest::symbol_table_test This patch adds a selftest fixture for overriding the "symtab" global, so that selftests involving symtab nodes can be isolated from each other: each selftest can have its own symbol_table instance. In particular, this ensures that nodes can have a predictable "order" and thus predictable dump names within selftests. gcc/ChangeLog: * cgraph.c: Include "selftest.h". (saved_symtab): New variable. (selftest::symbol_table_test::symbol_table_test): New ctor. (selftest::symbol_table_test::~symbol_table_test): New dtor. (selftest::test_symbol_table_test): New test. (selftest::cgraph_c_tests): New. * cgraph.h (saved_symtab): New decl. (selftest::symbol_table_test): New class. * selftest-run-tests.c (selftest::run_tests): Call selftest::cgraph_c_tests. * selftest.h (selftest::cgraph_c_tests): New decl. From-SVN: r265915 --- gcc/ChangeLog | 14 ++++++++++ gcc/cgraph.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ gcc/cgraph.h | 23 +++++++++++++++++ gcc/selftest-run-tests.c | 1 + gcc/selftest.h | 1 + 5 files changed, 106 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4af240a..46efe5d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2018-11-08 David Malcolm + + * cgraph.c: Include "selftest.h". + (saved_symtab): New variable. + (selftest::symbol_table_test::symbol_table_test): New ctor. + (selftest::symbol_table_test::~symbol_table_test): New dtor. + (selftest::test_symbol_table_test): New test. + (selftest::cgraph_c_tests): New. + * cgraph.h (saved_symtab): New decl. + (selftest::symbol_table_test): New class. + * selftest-run-tests.c (selftest::run_tests): Call + selftest::cgraph_c_tests. + * selftest.h (selftest::cgraph_c_tests): New decl. + 2018-11-08 Richard Biener * tree-data-ref.h (lambda_int): New typedef. diff --git a/gcc/cgraph.c b/gcc/cgraph.c index b432f7e..b3dd429 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -62,6 +62,7 @@ along with GCC; see the file COPYING3. If not see #include "gimplify.h" #include "stringpool.h" #include "attribs.h" +#include "selftest.h" /* FIXME: Only for PROP_loops, but cgraph shouldn't have to know about this. */ #include "tree-pass.h" @@ -3765,4 +3766,70 @@ cgraph_edge::sreal_frequency () : caller->count); } +/* A stashed copy of "symtab" for use by selftest::symbol_table_test. + This needs to be a global so that it can be a GC root, and thus + prevent the stashed copy from being garbage-collected if the GC runs + during a symbol_table_test. */ + +symbol_table *saved_symtab; + +#if CHECKING_P + +namespace selftest { + +/* class selftest::symbol_table_test. */ + +/* Constructor. Store the old value of symtab, and create a new one. */ + +symbol_table_test::symbol_table_test () +{ + gcc_assert (saved_symtab == NULL); + saved_symtab = symtab; + symtab = new (ggc_cleared_alloc ()) symbol_table (); +} + +/* Destructor. Restore the old value of symtab. */ + +symbol_table_test::~symbol_table_test () +{ + gcc_assert (saved_symtab != NULL); + symtab = saved_symtab; + saved_symtab = NULL; +} + +/* Verify that symbol_table_test works. */ + +static void +test_symbol_table_test () +{ + /* Simulate running two selftests involving symbol tables. */ + for (int i = 0; i < 2; i++) + { + symbol_table_test stt; + tree test_decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL, + get_identifier ("test_decl"), + build_function_type_list (void_type_node, + NULL_TREE)); + cgraph_node *node = cgraph_node::get_create (test_decl); + gcc_assert (node); + + /* Verify that the node has order 0 on both iterations, + and thus that nodes have predictable dump names in selftests. */ + ASSERT_EQ (node->order, 0); + ASSERT_STREQ (node->dump_name (), "test_decl/0"); + } +} + +/* Run all of the selftests within this file. */ + +void +cgraph_c_tests () +{ + test_symbol_table_test (); +} + +} // namespace selftest + +#endif /* CHECKING_P */ + #include "gt-cgraph.h" diff --git a/gcc/cgraph.h b/gcc/cgraph.h index c13d798..0215522 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -3353,4 +3353,27 @@ xstrdup_for_dump (const char *transient_str) return ggc_strdup (transient_str); } +extern GTY(()) symbol_table *saved_symtab; + +#if CHECKING_P + +namespace selftest { + +/* An RAII-style class for use in selftests for temporarily using a different + symbol_table, so that such tests can be isolated from each other. */ + +class symbol_table_test +{ + public: + /* Constructor. Override "symtab". */ + symbol_table_test (); + + /* Destructor. Restore the saved_symtab. */ + ~symbol_table_test (); +}; + +} // namespace selftest + +#endif /* CHECKING_P */ + #endif /* GCC_CGRAPH_H */ diff --git a/gcc/selftest-run-tests.c b/gcc/selftest-run-tests.c index 562ada7..6d65d24 100644 --- a/gcc/selftest-run-tests.c +++ b/gcc/selftest-run-tests.c @@ -73,6 +73,7 @@ selftest::run_tests () unique_ptr_tests_cc_tests (); opt_proposer_c_tests (); json_cc_tests (); + cgraph_c_tests (); optinfo_emit_json_cc_tests (); opt_problem_cc_tests (); diff --git a/gcc/selftest.h b/gcc/selftest.h index 8da7c4a..4e4c755 100644 --- a/gcc/selftest.h +++ b/gcc/selftest.h @@ -215,6 +215,7 @@ class test_runner alphabetical order. */ extern void attribute_c_tests (); extern void bitmap_c_tests (); +extern void cgraph_c_tests (); extern void diagnostic_c_tests (); extern void diagnostic_show_locus_c_tests (); extern void dumpfile_c_tests (); -- cgit v1.1 From 67124cb62dd566664aa53183821957fa97b27e54 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 8 Nov 2018 14:57:47 +0000 Subject: re PR middle-end/87916 (ICE in dwarf2out_abstract_function, at dwarf2out.c:22479 since r264943) PR middle-end/87916 * cgraphclones.c (duplicate_thunk_for_node): Also set DECL_IGNORED_P. From-SVN: r265916 --- gcc/ChangeLog | 5 ++++ gcc/cgraphclones.c | 4 ++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/other/pr87916.C | 45 ++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 gcc/testsuite/g++.dg/other/pr87916.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46efe5d..c83df0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Eric Botcazou + + PR middle-end/87916 + * cgraphclones.c (duplicate_thunk_for_node): Also set DECL_IGNORED_P. + 2018-11-08 David Malcolm * cgraph.c: Include "selftest.h". diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index e17959c..0fbc7a9 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -321,6 +321,10 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node) "artificial_thunk"); SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl)); + /* We need to force DECL_IGNORED_P because the new thunk is created after + early debug was run. */ + DECL_IGNORED_P (new_decl) = 1; + new_thunk = cgraph_node::create (new_decl); set_new_clone_decl_and_node_flags (new_thunk); new_thunk->definition = true; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6c36f3..63019e1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-11-08 Eric Botcazou + + * g++.dg/other/pr87916.C: New test. + 2018-11-08 Richard Biener PR tree-optimization/87929 diff --git a/gcc/testsuite/g++.dg/other/pr87916.C b/gcc/testsuite/g++.dg/other/pr87916.C new file mode 100644 index 0000000..5c69478 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr87916.C @@ -0,0 +1,45 @@ +// PR middle-end/87916 +// Testcase by Martin Liška + +// { dg-do compile } +// { dg-options "-O2 -g" } +// { dg-additional-options "-fPIC" { target fpic } } + +struct a { + virtual ~a(); +}; +template class c { +public: + class d { + public: + d(c); + b *operator->(); + }; +}; +int e, f; +class g { +public: + class h { + public: + virtual void j(g &, int &, bool) = 0; + }; + c k(); + int *l(); + int *m(); +}; +int *g::l() try { + for (c::d i(k());;) + i->j(*this, e, true); +} catch (int) { + return 0; +} +int *g::m() try { + for (c::d i(k());;) + i->j(*this, f, false); +} catch (int) { + return 0; +} +struct n : a, g::h { + void o(); + void j(g &, int &, bool) { o(); } +}; -- cgit v1.1 From 0d8f74b4cf06835a327aaef69787a4b7d9dc8e66 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 8 Nov 2018 15:19:20 +0000 Subject: decl.c (components_to_record): Remove obsolete kludge. * gcc-interface/decl.c (components_to_record): Remove obsolete kludge. * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the new type but do not take into account the setting on the old type for the new fields. Rename a local variable. (finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at offset 0, if any. (create_field_decl): Tweak comment. From-SVN: r265917 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/gcc-interface/decl.c | 18 +----------------- gcc/ada/gcc-interface/utils.c | 26 ++++++++++++++++++-------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7366612..a1b3c66 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2018-11-08 Eric Botcazou + + * gcc-interface/decl.c (components_to_record): Remove obsolete kludge. + * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the + new type but do not take into account the setting on the old type for + the new fields. Rename a local variable. + (finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at + offset 0, if any. + (create_field_decl): Tweak comment. + 2018-10-22 Eric Botcazou * gcc-interface/utils.c (unchecked_convert): Use local variables for diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c658aac..d8fb8ee 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -8146,23 +8146,7 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, /* Chain the variant part at the end of the field list. */ if (gnu_variant_part) - { - /* We make an exception if the variant part is at offset 0, has a fixed - size, and there is a single rep'ed field placed after it because, in - this case, there is an obvious order of increasing position. */ - if (variants_have_rep - && TREE_CODE (DECL_SIZE_UNIT (gnu_variant_part)) == INTEGER_CST - && gnu_rep_list - && gnu_field_list == gnu_rep_list - && !tree_int_cst_lt (DECL_FIELD_OFFSET (gnu_rep_list), - DECL_SIZE_UNIT (gnu_variant_part))) - { - DECL_CHAIN (gnu_variant_part) = gnu_field_list; - gnu_field_list = gnu_variant_part; - } - else - gnu_field_list = chainon (gnu_field_list, gnu_variant_part); - } + gnu_field_list = chainon (gnu_field_list, gnu_variant_part); if (cancel_alignment) SET_TYPE_ALIGN (gnu_record_type, 0); diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index e7dfb41..05959d6 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -973,6 +973,7 @@ make_packable_type (tree type, bool in_record, unsigned int max_align) Note that we rely on the pointer equality created here for TYPE_NAME to look through conversions in various places. */ TYPE_NAME (new_type) = TYPE_NAME (type); + TYPE_PACKED (new_type) = 1; TYPE_JUSTIFIED_MODULAR_P (new_type) = TYPE_JUSTIFIED_MODULAR_P (type); TYPE_CONTAINS_TEMPLATE_P (new_type) = TYPE_CONTAINS_TEMPLATE_P (type); TYPE_REVERSE_STORAGE_ORDER (new_type) = TYPE_REVERSE_STORAGE_ORDER (type); @@ -1018,7 +1019,7 @@ make_packable_type (tree type, bool in_record, unsigned int max_align) for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { tree new_field_type = TREE_TYPE (field); - tree new_field, new_size; + tree new_field, new_field_size; if (RECORD_OR_UNION_TYPE_P (new_field_type) && !TYPE_FAT_POINTER_P (new_field_type) @@ -1034,14 +1035,15 @@ make_packable_type (tree type, bool in_record, unsigned int max_align) && !TYPE_FAT_POINTER_P (new_field_type) && !TYPE_CONTAINS_TEMPLATE_P (new_field_type) && TYPE_ADA_SIZE (new_field_type)) - new_size = TYPE_ADA_SIZE (new_field_type); + new_field_size = TYPE_ADA_SIZE (new_field_type); else - new_size = DECL_SIZE (field); + new_field_size = DECL_SIZE (field); + /* This is a layout with full representation, alignment and size clauses + so we simply pass 0 as PACKED like gnat_to_gnu_field in this case. */ new_field = create_field_decl (DECL_NAME (field), new_field_type, new_type, - new_size, bit_position (field), - TYPE_PACKED (type), + new_field_size, bit_position (field), 0, !DECL_NONADDRESSABLE_P (field)); DECL_INTERNAL_P (new_field) = DECL_INTERNAL_P (field); @@ -1896,6 +1898,14 @@ finish_record_type (tree record_type, tree field_list, int rep_level, DECL_BIT_FIELD (field) = 0; } + /* Clear DECL_BIT_FIELD_TYPE for a variant part at offset 0, it's simply + not supported by the DECL_BIT_FIELD_REPRESENTATIVE machinery because + the variant part is always the last field in the list. */ + if (DECL_INTERNAL_P (field) + && TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE + && integer_zerop (pos)) + DECL_BIT_FIELD_TYPE (field) = NULL_TREE; + /* If we still have DECL_BIT_FIELD set at this point, we know that the field is technically not addressable. Except that it can actually be addressed if it is BLKmode and happens to be properly aligned. */ @@ -2725,9 +2735,9 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos, size = round_up (size, BITS_PER_UNIT); } - /* If we may, according to ADDRESSABLE, make a bitfield if a size is + /* If we may, according to ADDRESSABLE, make a bitfield when the size is specified for two reasons: first if the size differs from the natural - size. Second, if the alignment is insufficient. There are a number of + size; second, if the alignment is insufficient. There are a number of ways the latter can be true. We never make a bitfield if the type of the field has a nonconstant size, @@ -2735,7 +2745,7 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos, We do *preventively* make a bitfield when there might be the need for it but we don't have all the necessary information to decide, as is the case - of a field with no specified position in a packed record. + of a field in a packed record. We also don't look at STRICT_ALIGNMENT here, and rely on later processing in layout_decl or finish_record_type to clear the bit_field indication if -- cgit v1.1 From d8010ee4560a947f690891f919db177b03581f9a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 8 Nov 2018 15:28:20 +0000 Subject: dump_printf: add "%C" for dumping cgraph_node * This patch implements support for %C in dump_printf for dumping cgraph_node *. (I would have preferred to have a code for printing symtab_node * and both subclasses, but there doesn't seem to be a good way for -Wformat to handle inheritance, so, failing that, I went with this approach). gcc/c-family/ChangeLog: * c-format.c (local_cgraph_node_ptr_node): New variable. (gcc_dump_printf_char_table): Add entry for %C. (get_pointer_to_named_type): New function, taken from the handling code for "gimple *" from... (init_dynamic_diag_info): ...here. Add handling for "cgraph_node *". * c-format.h (T_CGRAPH_NODE): New. gcc/ChangeLog: * dump-context.h (ASSERT_IS_CGRAPH_NODE): New macro. * dumpfile.c (make_item_for_dump_cgraph_node): Move to before... (dump_pretty_printer::decode_format): Implement "%C" for cgraph_node *. (selftest::test_capture_of_dump_calls): Rename "where" to "stmt_loc". Convert test_decl to a function decl and set its location. Add a symbol_table_test RAII instance and a cgraph_node, using it to test "%C" and dump_symtab_node. gcc/testsuite/ChangeLog: * gcc.dg/format/gcc_diag-10.c (cgraph_node): New typedef. (test_dump): Add testing of %C. From-SVN: r265918 --- gcc/ChangeLog | 11 +++ gcc/c-family/ChangeLog | 10 +++ gcc/c-family/c-format.c | 56 ++++++++++----- gcc/c-family/c-format.h | 1 + gcc/dump-context.h | 8 +++ gcc/dumpfile.c | 115 ++++++++++++++++++++++-------- gcc/testsuite/ChangeLog | 5 ++ gcc/testsuite/gcc.dg/format/gcc_diag-10.c | 5 +- 8 files changed, 161 insertions(+), 50 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c83df0b..0ebab86 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2018-11-08 David Malcolm + + * dump-context.h (ASSERT_IS_CGRAPH_NODE): New macro. + * dumpfile.c (make_item_for_dump_cgraph_node): Move to before... + (dump_pretty_printer::decode_format): Implement "%C" for + cgraph_node *. + (selftest::test_capture_of_dump_calls): Rename "where" to + "stmt_loc". Convert test_decl to a function decl and set its + location. Add a symbol_table_test RAII instance and a + cgraph_node, using it to test "%C" and dump_symtab_node. + 2018-11-08 Eric Botcazou PR middle-end/87916 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index fbafb9d..1197871 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,13 @@ +2018-11-08 David Malcolm + + * c-format.c (local_cgraph_node_ptr_node): New variable. + (gcc_dump_printf_char_table): Add entry for %C. + (get_pointer_to_named_type): New function, taken from the handling + code for "gimple *" from... + (init_dynamic_diag_info): ...here. Add handling for + "cgraph_node *". + * c-format.h (T_CGRAPH_NODE): New. + 2018-10-19 Jason Merrill * c-cppbuiltin.c (c_cpp_builtins): Add diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index dc937c6..c8ae6c4 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -60,6 +60,7 @@ struct function_format_info /* Initialized in init_dynamic_diag_info. */ static GTY(()) tree local_tree_type_node; static GTY(()) tree local_gimple_ptr_node; +static GTY(()) tree local_cgraph_node_ptr_node; static GTY(()) tree locus; static bool decode_format_attr (tree, function_format_info *, int); @@ -803,6 +804,9 @@ static const format_char_info gcc_dump_printf_char_table[] = /* E and G require a "gimple *" argument at runtime. */ { "EG", 1, STD_C89, { T89_G, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, + /* C requires a "cgraph_node *" argument at runtime. */ + { "C", 1, STD_C89, { T_CGRAPH_NODE, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, + /* T requires a "tree" at runtime. */ { "T", 1, STD_C89, { T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, @@ -3882,6 +3886,33 @@ init_dynamic_gfc_info (void) } } +/* Lookup the type named NAME and return a pointer-to-NAME type if found. + Otherwise, return void_type_node if NAME has not been used yet, or NULL_TREE if + NAME is not a type (issuing an error). */ + +static tree +get_pointer_to_named_type (const char *name) +{ + tree result; + if ((result = maybe_get_identifier (name))) + { + result = identifier_global_value (result); + if (result) + { + if (TREE_CODE (result) != TYPE_DECL) + { + error ("%qs is not defined as a type", name); + result = NULL_TREE; + } + else + result = TREE_TYPE (result); + } + } + else + result = void_type_node; + return result; +} + /* Determine the types of "tree" and "location_t" in the code being compiled for use in GCC's diagnostic custom format attributes. You must have set dynamic_format_types before calling this function. */ @@ -3935,25 +3966,12 @@ init_dynamic_diag_info (void) /* Similar to the above but for gimple*. */ if (!local_gimple_ptr_node || local_gimple_ptr_node == void_type_node) - { - if ((local_gimple_ptr_node = maybe_get_identifier ("gimple"))) - { - local_gimple_ptr_node - = identifier_global_value (local_gimple_ptr_node); - if (local_gimple_ptr_node) - { - if (TREE_CODE (local_gimple_ptr_node) != TYPE_DECL) - { - error ("% is not defined as a type"); - local_gimple_ptr_node = 0; - } - else - local_gimple_ptr_node = TREE_TYPE (local_gimple_ptr_node); - } - } - else - local_gimple_ptr_node = void_type_node; - } + local_gimple_ptr_node = get_pointer_to_named_type ("gimple"); + + /* Similar to the above but for cgraph_node*. */ + if (!local_cgraph_node_ptr_node + || local_cgraph_node_ptr_node == void_type_node) + local_cgraph_node_ptr_node = get_pointer_to_named_type ("cgraph_node"); static tree hwi; diff --git a/gcc/c-family/c-format.h b/gcc/c-family/c-format.h index d984d10..eabb4f0 100644 --- a/gcc/c-family/c-format.h +++ b/gcc/c-family/c-format.h @@ -299,6 +299,7 @@ struct format_kind_info #define T99_UC { STD_C99, NULL, T_UC } #define T_V &void_type_node #define T89_G { STD_C89, NULL, &local_gimple_ptr_node } +#define T_CGRAPH_NODE { STD_C89, NULL, &local_cgraph_node_ptr_node } #define T89_T { STD_C89, NULL, &local_tree_type_node } #define T89_V { STD_C89, NULL, T_V } #define T_W &wchar_type_node diff --git a/gcc/dump-context.h b/gcc/dump-context.h index 3a45f23..ace139c 100644 --- a/gcc/dump-context.h +++ b/gcc/dump-context.h @@ -251,6 +251,14 @@ verify_item (const location &loc, (EXPECTED_LOCATION), (EXPECTED_TEXT)); \ SELFTEST_END_STMT +/* Verify that ITEM is a symtab node, with the expected values. */ + +#define ASSERT_IS_SYMTAB_NODE(ITEM, EXPECTED_LOCATION, EXPECTED_TEXT) \ + SELFTEST_BEGIN_STMT \ + verify_item (SELFTEST_LOCATION, (ITEM), OPTINFO_ITEM_KIND_SYMTAB_NODE, \ + (EXPECTED_LOCATION), (EXPECTED_TEXT)); \ + SELFTEST_END_STMT + } // namespace selftest #endif /* CHECKING_P */ diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 0b140ff..09c2490 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -748,6 +748,18 @@ dump_context::dump_generic_expr_loc (dump_flags_t dump_kind, dump_generic_expr (dump_kind, extra_dump_flags, t); } +/* Make an item for the given dump call. */ + +static optinfo_item * +make_item_for_dump_symtab_node (symtab_node *node) +{ + location_t loc = DECL_SOURCE_LOCATION (node->decl); + optinfo_item *item + = new optinfo_item (OPTINFO_ITEM_KIND_SYMTAB_NODE, loc, + xstrdup (node->dump_name ())); + return item; +} + /* dump_pretty_printer's ctor. */ dump_pretty_printer::dump_pretty_printer (dump_context *context, @@ -881,6 +893,8 @@ dump_pretty_printer::format_decoder_cb (pretty_printer *pp, text_info *text, Supported format codes (in addition to the standard pretty_printer ones) are: + %C: cgraph_node *: + Equivalent to: dump_symtab_node (MSG_*, node) %E: gimple *: Equivalent to: dump_gimple_expr (MSG_*, TDF_SLIM, stmt, 0) %G: gimple *: @@ -888,7 +902,9 @@ dump_pretty_printer::format_decoder_cb (pretty_printer *pp, text_info *text, %T: tree: Equivalent to: dump_generic_expr (MSG_*, arg, TDF_SLIM). - FIXME: add symtab_node? + TODO: add a format code that can handle (symtab_node*) *and* both + subclasses (presumably means teaching -Wformat about non-virtual + subclasses). These format codes build optinfo_item instances, thus capturing metadata about the arguments being dumped, as well as the textual output. */ @@ -901,6 +917,16 @@ dump_pretty_printer::decode_format (text_info *text, const char *spec, for later use (to capture metadata, rather than plain text). */ switch (*spec) { + case 'C': + { + cgraph_node *node = va_arg (*text->args_ptr, cgraph_node *); + + /* Make an item for the node, and stash it. */ + optinfo_item *item = make_item_for_dump_symtab_node (node); + stash_item (buffer_ptr, item); + return true; + } + case 'E': { gimple *stmt = va_arg (*text->args_ptr, gimple *); @@ -1023,18 +1049,6 @@ dump_context::dump_dec (dump_flags_t dump_kind, const poly_int &value) delete item; } -/* Make an item for the given dump call. */ - -static optinfo_item * -make_item_for_dump_symtab_node (symtab_node *node) -{ - location_t loc = DECL_SOURCE_LOCATION (node->decl); - optinfo_item *item - = new optinfo_item (OPTINFO_ITEM_KIND_SYMTAB_NODE, loc, - xstrdup (node->dump_name ())); - return item; -} - /* Output the name of NODE on appropriate dump streams. */ void @@ -2067,18 +2081,26 @@ test_capture_of_dump_calls (const line_table_case &case_) linemap_add (line_table, LC_ENTER, false, "test.txt", 0); linemap_line_start (line_table, 5, 100); linemap_add (line_table, LC_LEAVE, false, NULL, 0); - location_t where = linemap_position_for_column (line_table, 10); - if (where > LINE_MAP_MAX_LOCATION_WITH_COLS) + location_t decl_loc = linemap_position_for_column (line_table, 8); + location_t stmt_loc = linemap_position_for_column (line_table, 10); + if (stmt_loc > LINE_MAP_MAX_LOCATION_WITH_COLS) return; - dump_location_t loc = dump_location_t::from_location_t (where); + dump_location_t loc = dump_location_t::from_location_t (stmt_loc); gimple *stmt = gimple_build_return (NULL); - gimple_set_location (stmt, where); + gimple_set_location (stmt, stmt_loc); - tree test_decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, + tree test_decl = build_decl (decl_loc, FUNCTION_DECL, get_identifier ("test_decl"), - integer_type_node); + build_function_type_list (void_type_node, + NULL_TREE)); + + symbol_table_test tmp_symtab; + + cgraph_node *node = cgraph_node::get_create (test_decl); + gcc_assert (node); + /* Run all tests twice, with and then without optinfo enabled, to ensure that immediate destinations vs optinfo-based destinations both work, independently of each other, with no leaks. */ @@ -2135,7 +2157,7 @@ test_capture_of_dump_calls (const line_table_case &case_) ASSERT_EQ (info->get_kind (), OPTINFO_KIND_NOTE); ASSERT_EQ (info->num_items (), 2); ASSERT_IS_TEXT (info->get_item (0), "gimple: "); - ASSERT_IS_GIMPLE (info->get_item (1), where, "return;"); + ASSERT_IS_GIMPLE (info->get_item (1), stmt_loc, "return;"); } } @@ -2153,7 +2175,25 @@ test_capture_of_dump_calls (const line_table_case &case_) ASSERT_EQ (info->get_kind (), OPTINFO_KIND_NOTE); ASSERT_EQ (info->num_items (), 2); ASSERT_IS_TEXT (info->get_item (0), "gimple: "); - ASSERT_IS_GIMPLE (info->get_item (1), where, "return;\n"); + ASSERT_IS_GIMPLE (info->get_item (1), stmt_loc, "return;\n"); + } + } + + /* Test of dump_printf with %C. */ + { + temp_dump_context tmp (with_optinfo, true, + MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING); + dump_printf (MSG_NOTE, "node: %C", node); + + ASSERT_DUMPED_TEXT_EQ (tmp, "node: test_decl/0"); + if (with_optinfo) + { + optinfo *info = tmp.get_pending_optinfo (); + ASSERT_TRUE (info != NULL); + ASSERT_EQ (info->get_kind (), OPTINFO_KIND_NOTE); + ASSERT_EQ (info->num_items (), 2); + ASSERT_IS_TEXT (info->get_item (0), "node: "); + ASSERT_IS_SYMTAB_NODE (info->get_item (1), decl_loc, "test_decl/0"); } } @@ -2184,8 +2224,8 @@ test_capture_of_dump_calls (const line_table_case &case_) ASSERT_IS_TEXT (info->get_item (2), " and "); ASSERT_IS_TREE (info->get_item (3), UNKNOWN_LOCATION, "test_decl"); ASSERT_IS_TEXT (info->get_item (4), " 42 consecutive "); - ASSERT_IS_GIMPLE (info->get_item (5), where, "return;"); - ASSERT_IS_GIMPLE (info->get_item (6), where, "return;"); + ASSERT_IS_GIMPLE (info->get_item (5), stmt_loc, "return;"); + ASSERT_IS_GIMPLE (info->get_item (6), stmt_loc, "return;"); ASSERT_IS_TEXT (info->get_item (7), " after\n"); } } @@ -2202,7 +2242,7 @@ test_capture_of_dump_calls (const line_table_case &case_) { optinfo *info = tmp.get_pending_optinfo (); ASSERT_TRUE (info != NULL); - ASSERT_EQ (info->get_location_t (), where); + ASSERT_EQ (info->get_location_t (), stmt_loc); ASSERT_EQ (info->get_kind (), OPTINFO_KIND_NOTE); ASSERT_EQ (info->num_items (), 2); ASSERT_IS_TEXT (info->get_item (0), "test of tree: "); @@ -2221,7 +2261,7 @@ test_capture_of_dump_calls (const line_table_case &case_) { optinfo *info = tmp.get_pending_optinfo (); ASSERT_TRUE (info != NULL); - ASSERT_EQ (info->get_location_t (), where); + ASSERT_EQ (info->get_location_t (), stmt_loc); ASSERT_EQ (info->get_kind (), OPTINFO_KIND_NOTE); ASSERT_EQ (info->num_items (), 1); ASSERT_IS_TREE (info->get_item (0), UNKNOWN_LOCATION, "1"); @@ -2242,7 +2282,7 @@ test_capture_of_dump_calls (const line_table_case &case_) optinfo *info = tmp.get_pending_optinfo (); ASSERT_TRUE (info != NULL); ASSERT_EQ (info->num_items (), 1); - ASSERT_IS_GIMPLE (info->get_item (0), where, "return;\n"); + ASSERT_IS_GIMPLE (info->get_item (0), stmt_loc, "return;\n"); } } @@ -2258,7 +2298,7 @@ test_capture_of_dump_calls (const line_table_case &case_) optinfo *info = tmp.get_pending_optinfo (); ASSERT_TRUE (info != NULL); ASSERT_EQ (info->num_items (), 1); - ASSERT_IS_GIMPLE (info->get_item (0), where, "return;\n"); + ASSERT_IS_GIMPLE (info->get_item (0), stmt_loc, "return;\n"); } } @@ -2274,7 +2314,7 @@ test_capture_of_dump_calls (const line_table_case &case_) optinfo *info = tmp.get_pending_optinfo (); ASSERT_TRUE (info != NULL); ASSERT_EQ (info->num_items (), 1); - ASSERT_IS_GIMPLE (info->get_item (0), where, "return;"); + ASSERT_IS_GIMPLE (info->get_item (0), stmt_loc, "return;"); } } @@ -2290,11 +2330,28 @@ test_capture_of_dump_calls (const line_table_case &case_) optinfo *info = tmp.get_pending_optinfo (); ASSERT_TRUE (info != NULL); ASSERT_EQ (info->num_items (), 1); - ASSERT_IS_GIMPLE (info->get_item (0), where, "return;"); + ASSERT_IS_GIMPLE (info->get_item (0), stmt_loc, "return;"); } } } + /* symtab_node. */ + { + temp_dump_context tmp (with_optinfo, true, + MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING); + dump_symtab_node (MSG_NOTE, node); + + ASSERT_DUMPED_TEXT_EQ (tmp, "test_decl/0"); + if (with_optinfo) + { + optinfo *info = tmp.get_pending_optinfo (); + ASSERT_TRUE (info != NULL); + ASSERT_EQ (info->get_kind (), OPTINFO_KIND_NOTE); + ASSERT_EQ (info->num_items (), 1); + ASSERT_IS_SYMTAB_NODE (info->get_item (0), decl_loc, "test_decl/0"); + } + } + /* poly_int. */ { temp_dump_context tmp (with_optinfo, true, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 63019e1..1799cb5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 David Malcolm + + * gcc.dg/format/gcc_diag-10.c (cgraph_node): New typedef. + (test_dump): Add testing of %C. + 2018-11-08 Eric Botcazou * g++.dg/other/pr87916.C: New test. diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-10.c b/gcc/testsuite/gcc.dg/format/gcc_diag-10.c index 2f6a002..97a1993 100644 --- a/gcc/testsuite/gcc.dg/format/gcc_diag-10.c +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-10.c @@ -20,7 +20,7 @@ typedef union tree_node *tree; typedef struct gimple gimple; /* Likewise for gimple. */ -typedef struct gimple gimple; +typedef struct cgraph_node cgraph_node; #define FORMAT(kind) __attribute__ ((format (__gcc_## kind ##__, 1, 2))) @@ -162,7 +162,7 @@ void test_cxxdiag (tree t, gimple *gc) cxxdiag ("%<%X%>", t); } -void test_dump (tree t, gimple *stmt) +void test_dump (tree t, gimple *stmt, cgraph_node *node) { dump ("%<"); /* { dg-warning "unterminated quoting directive" } */ dump ("%>"); /* { dg-warning "unmatched quoting directive " } */ @@ -182,4 +182,5 @@ void test_dump (tree t, gimple *stmt) dump ("%E", stmt); dump ("%T", t); dump ("%G", stmt); + dump ("%C", node); } -- cgit v1.1 From 204839e7c41678c3f93975fe4356492040fcf411 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 8 Nov 2018 15:31:13 +0000 Subject: Support %f in pp_format Numerous formatted messages from the inliner use %f, mostly as %f, but occasionally with length modifiers. This patch implements the simplest case of "%f" for pp_format (with no modifier support) to make it easier to port these messages from fprintf to dump_printf_loc. The selftest has an assertion that %f on 1.0 is printed as "1.000000". This comes from the host's sprintf, and I believe this is guaranteed by POSIX: "If the precision is missing, it shall be taken as 6". If this is an issue I can drop the selftest. gcc/c-family/ChangeLog: * c-format.c (gcc_dump_printf_char_table): Add entry for %f. gcc/ChangeLog: * pretty-print.c (pp_format): Handle %f. (selftest::test_pp_format): Add test of %f. * pretty-print.h (pp_double): New macro. gcc/testsuite/ChangeLog: * gcc.dg/format/gcc_diag-10.c: Add coverage for %f. From-SVN: r265919 --- gcc/ChangeLog | 6 ++++++ gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c-format.c | 3 +++ gcc/pretty-print.c | 6 ++++++ gcc/pretty-print.h | 1 + gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/format/gcc_diag-10.c | 2 ++ 7 files changed, 26 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ebab86..bc91ee2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-11-08 David Malcolm + * pretty-print.c (pp_format): Handle %f. + (selftest::test_pp_format): Add test of %f. + * pretty-print.h (pp_double): New macro. + +2018-11-08 David Malcolm + * dump-context.h (ASSERT_IS_CGRAPH_NODE): New macro. * dumpfile.c (make_item_for_dump_cgraph_node): Move to before... (dump_pretty_printer::decode_format): Implement "%C" for diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 1197871..ac23539 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,9 @@ 2018-11-08 David Malcolm + * c-format.c (gcc_dump_printf_char_table): Add entry for %f. + +2018-11-08 David Malcolm + * c-format.c (local_cgraph_node_ptr_node): New variable. (gcc_dump_printf_char_table): Add entry for %C. (get_pointer_to_named_type): New function, taken from the handling diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index c8ae6c4..6613092 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -810,6 +810,9 @@ static const format_char_info gcc_dump_printf_char_table[] = /* T requires a "tree" at runtime. */ { "T", 1, STD_C89, { T89_T, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, + /* %f requires a "double"; it doesn't support modifiers. */ + { "f", 0, STD_C89, { T89_D, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "\"", NULL }, + { NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL } }; diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index 7dd900b..19ef75b 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -977,6 +977,7 @@ pp_indent (pretty_printer *pp) %ld, %li, %lo, %lu, %lx: long versions of the above. %lld, %lli, %llo, %llu, %llx: long long versions. %wd, %wi, %wo, %wu, %wx: HOST_WIDE_INT versions. + %f: double %c: character. %s: string. %p: pointer (printed in a host-dependent manner). @@ -1307,6 +1308,10 @@ pp_format (pretty_printer *pp, text_info *text) (pp, *text->args_ptr, precision, unsigned, "u"); break; + case 'f': + pp_double (pp, va_arg (*text->args_ptr, double)); + break; + case 'Z': { int *v = va_arg (*text->args_ptr, int *); @@ -2160,6 +2165,7 @@ test_pp_format () ASSERT_PP_FORMAT_2 ("17 12345678", "%wo %x", (HOST_WIDE_INT)15, 0x12345678); ASSERT_PP_FORMAT_2 ("0xcafebabe 12345678", "%wx %x", (HOST_WIDE_INT)0xcafebabe, 0x12345678); + ASSERT_PP_FORMAT_2 ("1.000000 12345678", "%f %x", 1.0, 0x12345678); ASSERT_PP_FORMAT_2 ("A 12345678", "%c %x", 'A', 0x12345678); ASSERT_PP_FORMAT_2 ("hello world 12345678", "%s %x", "hello world", 0x12345678); diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index 2decc51..a6e60f1 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -330,6 +330,7 @@ pp_get_prefix (const pretty_printer *pp) { return pp->prefix; } pp_string (PP, pp_buffer (PP)->digit_buffer); \ } \ while (0) +#define pp_double(PP, F) pp_scalar (PP, "%f", F) #define pp_pointer(PP, P) pp_scalar (PP, "%p", P) #define pp_identifier(PP, ID) pp_string (PP, (pp_translate_identifiers (PP) \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1799cb5..f4fd981 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2018-11-08 David Malcolm + * gcc.dg/format/gcc_diag-10.c: Add coverage for %f. + +2018-11-08 David Malcolm + * gcc.dg/format/gcc_diag-10.c (cgraph_node): New typedef. (test_dump): Add testing of %C. diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-10.c b/gcc/testsuite/gcc.dg/format/gcc_diag-10.c index 97a1993..ba2629b 100644 --- a/gcc/testsuite/gcc.dg/format/gcc_diag-10.c +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-10.c @@ -183,4 +183,6 @@ void test_dump (tree t, gimple *stmt, cgraph_node *node) dump ("%T", t); dump ("%G", stmt); dump ("%C", node); + dump ("%f", 1.0); + dump ("%4.2f", 1.0); /* { dg-warning "format" } */ } -- cgit v1.1 From 4174a33ac66f45536e3d7bd46167d7f678310931 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 8 Nov 2018 15:38:30 +0000 Subject: ipa-inline.c/tree-inline.c: port from fprintf to dump API (PR ipa/86395) This patch ports various fprintf calls in the inlining code to using the dump API, using the %C format code for printing cgraph_node *. I focussed on the dump messages that seemed most significant to end-users; I didn't port all of the calls. Doing so makes this information appear in -fopt-info and in optimization records, rather than just in the dump_file. It also changes the affected dumpfile-dumps from being unconditional (assuming the dump_file is enabled) to being guarded by the MSG_* status. Hence various tests with dg-final scan-*-dump directives need to gain "-all" or "-optimized" suffixes to -fdump-ipa-inline. The use of %C throughout also slightly changes the dump format for several messages, e.g. changing: Inlining void inline_me(char*) into int main(int, char**). to: ../../src/gcc/testsuite/g++.dg/tree-ssa/inline-1.C:13:8: optimized: Inlining void inline_me(char*)/0 into int main(int, char**)/2. amongst other things adding "/order" suffixes to the cgraph node names. gcc/ChangeLog: PR ipa/86395 * doc/invoke.texi (-fdump-ipa-): Document the "-optimized", "-missed", "-note", and "-all" sub-options. * ipa-inline.c (caller_growth_limits): Port from fprintf to dump API. (can_early_inline_edge_p): Likewise. (want_early_inline_function_p): Likewise. (want_inline_self_recursive_call_p): Likewise. (recursive_inlining): Likewise. (inline_small_functions): Likewise. (flatten_function): Likewise. (ipa_inline): Likewise. (inline_always_inline_functions): Likewise. (early_inline_small_functions): Likewise. (early_inliner): Likewise. * tree-inline.c (expand_call_inline): Likewise. gcc/testsuite/ChangeLog: PR ipa/86395 * g++.dg/ipa/devirt-12.C: Add "-all" suffix to "-fdump-ipa-inline". * g++.dg/ipa/imm-devirt-1.C: Add "-optimized" suffix to "-fdump-tree-einline". * g++.dg/tree-prof/inline_mismatch_args.C: Add "-all" suffix to "-fdump-tree-einline". * g++.dg/tree-ssa/inline-1.C: Add "-optimized" suffix to "-fdump-tree-einline". * g++.dg/tree-ssa/inline-2.C: Likewise. * g++.dg/tree-ssa/inline-3.C: Likewise. * g++.dg/tree-ssa/inline-4.C: New test, based on inline-1.C, but using "-fopt-info-inline". * gcc.dg/ipa/fopt-info-inline-1.c: New test. * gcc.dg/ipa/inline-4.c: Add "-all" suffix to "-fdump-ipa-inline". Add "-fopt-info-inline" and dg-optimized directive. * gcc.dg/ipa/inline-7.c: Add "-optimized" suffix to "-fdump-tree-einline". Add "-fopt-info-inline" and dg-optimized directive. Update scan-tree-dump-times to reflect /order suffixes. * gcc.dg/ipa/inlinehint-4.c: Update scan-tree-dump-times to reflect /order suffixes. * gcc.dg/plugin/dump-1.c: Add "-loop" to "-fopt-info-note" to avoid getting extra messages from inliner. * gcc.dg/plugin/dump-2.c: Likewise. * gcc.dg/pr26570.c: Add dg-prune-output to ignore new "function body not available" missed optimization messages. * gcc.dg/pr71969-2.c: Update scan-tree-dump-times to reflect /order suffixes. * gcc.dg/pr71969-3.c: Likewise. * gcc.dg/tree-ssa/inline-11.c: Add "-all" suffix to "-fdump-tree-einline". * gcc.dg/tree-ssa/inline-3.c: Add "-optimized" suffix to "-fdump-tree-einline". Update scan-tree-dump-times to reflect /order suffixes. * gcc.dg/tree-ssa/inline-4.c: Add "-optimized" suffix to "-fdump-tree-einline". Add "-fopt-info-inline" and dg-optimized directive. * gcc.dg/tree-ssa/inline-8.c: Add "-optimized" suffix to "-fdump-tree-einline". * gfortran.dg/pr79966.f90: Update scan-ipa-dump to reflect /order suffixes. From-SVN: r265920 --- gcc/ChangeLog | 19 ++ gcc/doc/invoke.texi | 13 ++ gcc/ipa-inline.c | 191 +++++++++++---------- gcc/testsuite/ChangeLog | 46 +++++ gcc/testsuite/g++.dg/ipa/devirt-12.C | 2 +- gcc/testsuite/g++.dg/ipa/imm-devirt-1.C | 2 +- .../g++.dg/tree-prof/inline_mismatch_args.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/inline-1.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/inline-2.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/inline-3.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/inline-4.C | 32 ++++ gcc/testsuite/gcc.dg/ipa/fopt-info-inline-1.c | 44 +++++ gcc/testsuite/gcc.dg/ipa/inline-4.c | 4 +- gcc/testsuite/gcc.dg/ipa/inline-7.c | 6 +- gcc/testsuite/gcc.dg/ipa/inlinehint-4.c | 4 +- gcc/testsuite/gcc.dg/plugin/dump-1.c | 2 +- gcc/testsuite/gcc.dg/plugin/dump-2.c | 2 +- gcc/testsuite/gcc.dg/pr26570.c | 1 + gcc/testsuite/gcc.dg/pr71969-2.c | 2 +- gcc/testsuite/gcc.dg/pr71969-3.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/inline-11.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/inline-3.c | 6 +- gcc/testsuite/gcc.dg/tree-ssa/inline-4.c | 6 +- gcc/testsuite/gcc.dg/tree-ssa/inline-8.c | 2 +- gcc/testsuite/gfortran.dg/pr79966.f90 | 2 +- gcc/tree-inline.c | 20 ++- 26 files changed, 294 insertions(+), 124 deletions(-) create mode 100644 gcc/testsuite/g++.dg/tree-ssa/inline-4.C create mode 100644 gcc/testsuite/gcc.dg/ipa/fopt-info-inline-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc91ee2..c3e77f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,24 @@ 2018-11-08 David Malcolm + PR ipa/86395 + * doc/invoke.texi (-fdump-ipa-): Document the "-optimized", + "-missed", "-note", and "-all" sub-options. + * ipa-inline.c (caller_growth_limits): Port from fprintf to dump + API. + (can_early_inline_edge_p): Likewise. + (want_early_inline_function_p): Likewise. + (want_inline_self_recursive_call_p): Likewise. + (recursive_inlining): Likewise. + (inline_small_functions): Likewise. + (flatten_function): Likewise. + (ipa_inline): Likewise. + (inline_always_inline_functions): Likewise. + (early_inline_small_functions): Likewise. + (early_inliner): Likewise. + * tree-inline.c (expand_call_inline): Likewise. + +2018-11-08 David Malcolm + * pretty-print.c (pp_format): Handle %f. (selftest::test_pp_format): Add test of %f. * pretty-print.h (pp_double): New macro. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 849bb76..24136eb 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -14085,6 +14085,7 @@ instruction numbers for the links to the previous and next instructions in a sequence. @item -fdump-ipa-@var{switch} +@itemx -fdump-ipa-@var{switch}-@var{options} @opindex fdump-ipa Control the dumping at various stages of inter-procedural analysis language tree to a file. The file name is generated by appending a @@ -14105,6 +14106,18 @@ Dump after function inlining. @end table +Additionally, the options @option{-optimized}, @option{-missed}, +@option{-note}, and @option{-all} can be provided, with the same meaning +as for @option{-fopt-info}, defaulting to @option{-optimized}. + +For example, @option{-fdump-ipa-inline-optimized-missed} will emit +information on callsites that were inlined, along with callsites +that were not inlined. + +By default, the dump will contain messages about successful +optimizations (equivalent to @option {-optimized}) together with +low-level details about the analysis. + @item -fdump-lang-all @itemx -fdump-lang-@var{switch} @itemx -fdump-lang-@var{switch}-@var{options} diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index bcd1653..e04ede7 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -227,20 +227,21 @@ caller_growth_limits (struct cgraph_edge *e) static void report_inline_failed_reason (struct cgraph_edge *e) { - if (dump_file) + if (dump_enabled_p ()) { - fprintf (dump_file, " not inlinable: %s -> %s, %s\n", - e->caller->dump_name (), - e->callee->dump_name (), - cgraph_inline_failed_string (e->inline_failed)); + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " not inlinable: %C -> %C, %s\n", + e->caller, e->callee, + cgraph_inline_failed_string (e->inline_failed)); if ((e->inline_failed == CIF_TARGET_OPTION_MISMATCH || e->inline_failed == CIF_OPTIMIZATION_MISMATCH) && e->caller->lto_file_data && e->callee->ultimate_alias_target ()->lto_file_data) { - fprintf (dump_file, " LTO objects: %s, %s\n", - e->caller->lto_file_data->file_name, - e->callee->ultimate_alias_target ()->lto_file_data->file_name); + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " LTO objects: %s, %s\n", + e->caller->lto_file_data->file_name, + e->callee->ultimate_alias_target ()->lto_file_data->file_name); } if (e->inline_failed == CIF_TARGET_OPTION_MISMATCH) cl_target_option_print_diff @@ -569,8 +570,9 @@ can_early_inline_edge_p (struct cgraph_edge *e) if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->caller->decl)) || !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->decl))) { - if (dump_file) - fprintf (dump_file, " edge not inlinable: not in SSA form\n"); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " edge not inlinable: not in SSA form\n"); return false; } if (!can_inline_edge_p (e, true, true) @@ -630,34 +632,34 @@ want_early_inline_function_p (struct cgraph_edge *e) else if (!e->maybe_hot_p () && growth > 0) { - if (dump_file) - fprintf (dump_file, " will not early inline: %s->%s, " - "call is cold and code would grow by %i\n", - e->caller->dump_name (), - callee->dump_name (), - growth); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " will not early inline: %C->%C, " + "call is cold and code would grow by %i\n", + e->caller, callee, + growth); want_inline = false; } else if (growth > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS)) { - if (dump_file) - fprintf (dump_file, " will not early inline: %s->%s, " - "growth %i exceeds --param early-inlining-insns\n", - e->caller->dump_name (), - callee->dump_name (), - growth); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " will not early inline: %C->%C, " + "growth %i exceeds --param early-inlining-insns\n", + e->caller, callee, + growth); want_inline = false; } else if ((n = num_calls (callee)) != 0 && growth * (n + 1) > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS)) { - if (dump_file) - fprintf (dump_file, " will not early inline: %s->%s, " - "growth %i exceeds --param early-inlining-insns " - "divided by number of calls\n", - e->caller->dump_name (), - callee->dump_name (), - growth); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " will not early inline: %C->%C, " + "growth %i exceeds --param early-inlining-insns " + "divided by number of calls\n", + e->caller, callee, + growth); want_inline = false; } } @@ -936,8 +938,9 @@ want_inline_self_recursive_call_p (struct cgraph_edge *edge, want_inline = false; } } - if (!want_inline && dump_file) - fprintf (dump_file, " not inlining recursively: %s\n", reason); + if (!want_inline && dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, edge->call_stmt, + " not inlining recursively: %s\n", reason); return want_inline; } @@ -1562,14 +1565,14 @@ recursive_inlining (struct cgraph_edge *edge, if (!master_clone) return false; - if (dump_file) - fprintf (dump_file, - "\n Inlined %i times, " - "body grown from size %i to %i, time %f to %f\n", n, - ipa_fn_summaries->get (master_clone)->size, - ipa_fn_summaries->get (node)->size, - ipa_fn_summaries->get (master_clone)->time.to_double (), - ipa_fn_summaries->get (node)->time.to_double ()); + if (dump_enabled_p ()) + dump_printf_loc (MSG_NOTE, edge->call_stmt, + "\n Inlined %i times, " + "body grown from size %i to %i, time %f to %f\n", n, + ipa_fn_summaries->get (master_clone)->size, + ipa_fn_summaries->get (node)->size, + ipa_fn_summaries->get (master_clone)->time.to_double (), + ipa_fn_summaries->get (node)->time.to_double ()); /* Remove master clone we used for inlining. We rely that clones inlined into master clone gets queued just before master clone so we don't @@ -2078,17 +2081,20 @@ inline_small_functions (void) update_callee_keys (&edge_heap, n, updated_nodes); bitmap_clear (updated_nodes); - if (dump_file) + if (dump_enabled_p ()) { ipa_fn_summary *s = ipa_fn_summaries->get (edge->caller); - fprintf (dump_file, - " Inlined %s into %s which now has time %f and size %i, " - "net change of %+i.\n", - xstrdup_for_dump (edge->callee->name ()), - xstrdup_for_dump (edge->caller->name ()), - s->time.to_double (), - s->size, - overall_size - old_size); + + /* dump_printf can't handle %+i. */ + char buf_net_change[100]; + snprintf (buf_net_change, sizeof buf_net_change, "%+i", + overall_size - old_size); + + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, edge->call_stmt, + " Inlined %C into %C which now has time %f and " + "size %i, net change of %s.\n", + edge->callee, edge->caller, + s->time.to_double (), s->size, buf_net_change); } if (min_size > overall_size) { @@ -2101,11 +2107,11 @@ inline_small_functions (void) } free_growth_caches (); - if (dump_file) - fprintf (dump_file, - "Unit growth for small function inlining: %i->%i (%i%%)\n", - initial_size, overall_size, - initial_size ? overall_size * 100 / (initial_size) - 100: 0); + if (dump_enabled_p ()) + dump_printf (MSG_NOTE, + "Unit growth for small function inlining: %i->%i (%i%%)\n", + initial_size, overall_size, + initial_size ? overall_size * 100 / (initial_size) - 100: 0); symtab->remove_edge_removal_hook (edge_removal_hook_holder); } @@ -2130,11 +2136,10 @@ flatten_function (struct cgraph_node *node, bool early) /* We've hit cycle? It is time to give up. */ if (callee->aux) { - if (dump_file) - fprintf (dump_file, - "Not inlining %s into %s to avoid cycle.\n", - xstrdup_for_dump (callee->name ()), - xstrdup_for_dump (e->caller->name ())); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + "Not inlining %C into %C to avoid cycle.\n", + callee, e->caller); if (cgraph_inline_failed_type (e->inline_failed) != CIF_FINAL_ERROR) e->inline_failed = CIF_RECURSIVE_INLINING; continue; @@ -2159,25 +2164,27 @@ flatten_function (struct cgraph_node *node, bool early) if (e->recursive_p ()) { - if (dump_file) - fprintf (dump_file, "Not inlining: recursive call.\n"); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + "Not inlining: recursive call.\n"); continue; } if (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->decl)) != gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->decl))) { - if (dump_file) - fprintf (dump_file, "Not inlining: SSA form does not match.\n"); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + "Not inlining: SSA form does not match.\n"); continue; } /* Inline the edge and flatten the inline clone. Avoid recursing through the original node if the node was cloned. */ - if (dump_file) - fprintf (dump_file, " Inlining %s into %s.\n", - xstrdup_for_dump (callee->name ()), - xstrdup_for_dump (e->caller->name ())); + if (dump_enabled_p ()) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, e->call_stmt, + " Inlining %C into %C.\n", + callee, e->caller); orig_callee = callee; inline_call (e, true, NULL, NULL, false); if (e->callee != orig_callee) @@ -2589,13 +2596,12 @@ ipa_inline (void) /* Free ipa-prop structures if they are no longer needed. */ ipa_free_all_structures_after_iinln (); + if (dump_enabled_p ()) + dump_printf (MSG_NOTE, + "\nInlined %i calls, eliminated %i functions\n\n", + ncalls_inlined, nfunctions_inlined); if (dump_file) - { - fprintf (dump_file, - "\nInlined %i calls, eliminated %i functions\n\n", - ncalls_inlined, nfunctions_inlined); - dump_inline_stats (); - } + dump_inline_stats (); if (dump_file) ipa_dump_fn_summaries (dump_file); @@ -2618,9 +2624,10 @@ inline_always_inline_functions (struct cgraph_node *node) if (e->recursive_p ()) { - if (dump_file) - fprintf (dump_file, " Not inlining recursive call to %s.\n", - e->callee->name ()); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " Not inlining recursive call to %C.\n", + e->callee); e->inline_failed = CIF_RECURSIVE_INLINING; continue; } @@ -2636,10 +2643,10 @@ inline_always_inline_functions (struct cgraph_node *node) continue; } - if (dump_file) - fprintf (dump_file, " Inlining %s into %s (always_inline).\n", - xstrdup_for_dump (e->callee->name ()), - xstrdup_for_dump (e->caller->name ())); + if (dump_enabled_p ()) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, e->call_stmt, + " Inlining %C into %C (always_inline).\n", + e->callee, e->caller); inline_call (e, true, NULL, NULL, false); inlined = true; } @@ -2675,27 +2682,29 @@ early_inline_small_functions (struct cgraph_node *node) && !opt_for_fn (node->decl, flag_inline_functions)) continue; - if (dump_file) - fprintf (dump_file, "Considering inline candidate %s.\n", - callee->name ()); + if (dump_enabled_p ()) + dump_printf_loc (MSG_NOTE, e->call_stmt, + "Considering inline candidate %C.\n", + callee); if (!can_early_inline_edge_p (e)) continue; if (e->recursive_p ()) { - if (dump_file) - fprintf (dump_file, " Not inlining: recursive call.\n"); + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt, + " Not inlining: recursive call.\n"); continue; } if (!want_early_inline_function_p (e)) continue; - if (dump_file) - fprintf (dump_file, " Inlining %s into %s.\n", - xstrdup_for_dump (callee->name ()), - xstrdup_for_dump (e->caller->name ())); + if (dump_enabled_p ()) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, e->call_stmt, + " Inlining %C into %C.\n", + callee, e->caller); inline_call (e, true, NULL, NULL, false); inlined = true; } @@ -2755,9 +2764,9 @@ early_inliner (function *fun) { /* When the function is marked to be flattened, recursively inline all calls in it. */ - if (dump_file) - fprintf (dump_file, - "Flattening %s\n", node->name ()); + if (dump_enabled_p ()) + dump_printf (MSG_OPTIMIZED_LOCATIONS, + "Flattening %C\n", node); flatten_function (node, true); inlined = true; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f4fd981..c7767ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,51 @@ 2018-11-08 David Malcolm + PR ipa/86395 + * g++.dg/ipa/devirt-12.C: Add "-all" suffix to + "-fdump-ipa-inline". + * g++.dg/ipa/imm-devirt-1.C: Add "-optimized" suffix to + "-fdump-tree-einline". + * g++.dg/tree-prof/inline_mismatch_args.C: Add "-all" suffix to + "-fdump-tree-einline". + * g++.dg/tree-ssa/inline-1.C: Add "-optimized" suffix to + "-fdump-tree-einline". + * g++.dg/tree-ssa/inline-2.C: Likewise. + * g++.dg/tree-ssa/inline-3.C: Likewise. + * g++.dg/tree-ssa/inline-4.C: New test, based on inline-1.C, but + using "-fopt-info-inline". + * gcc.dg/ipa/fopt-info-inline-1.c: New test. + * gcc.dg/ipa/inline-4.c: Add "-all" suffix to + "-fdump-ipa-inline". Add "-fopt-info-inline" and dg-optimized + directive. + * gcc.dg/ipa/inline-7.c: Add "-optimized" suffix to + "-fdump-tree-einline". Add "-fopt-info-inline" and dg-optimized + directive. Update scan-tree-dump-times to reflect /order + suffixes. + * gcc.dg/ipa/inlinehint-4.c: Update scan-tree-dump-times to + reflect /order suffixes. + * gcc.dg/plugin/dump-1.c: Add "-loop" to "-fopt-info-note" to + avoid getting extra messages from inliner. + * gcc.dg/plugin/dump-2.c: Likewise. + * gcc.dg/pr26570.c: Add dg-prune-output to ignore new + "function body not available" missed optimization messages. + * gcc.dg/pr71969-2.c: Update scan-tree-dump-times to reflect + /order suffixes. + * gcc.dg/pr71969-3.c: Likewise. + * gcc.dg/tree-ssa/inline-11.c: Add "-all" suffix to + "-fdump-tree-einline". + * gcc.dg/tree-ssa/inline-3.c: Add "-optimized" suffix to + "-fdump-tree-einline". Update scan-tree-dump-times to reflect + /order suffixes. + * gcc.dg/tree-ssa/inline-4.c: Add "-optimized" suffix to + "-fdump-tree-einline". Add "-fopt-info-inline" and dg-optimized + directive. + * gcc.dg/tree-ssa/inline-8.c: Add "-optimized" suffix to + "-fdump-tree-einline". + * gfortran.dg/pr79966.f90: Update scan-ipa-dump to reflect /order + suffixes. + +2018-11-08 David Malcolm + * gcc.dg/format/gcc_diag-10.c: Add coverage for %f. 2018-11-08 David Malcolm diff --git a/gcc/testsuite/g++.dg/ipa/devirt-12.C b/gcc/testsuite/g++.dg/ipa/devirt-12.C index 93ce251..60271a0 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-12.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-12.C @@ -1,5 +1,5 @@ // { dg-do compile { target c++11 } } -// { dg-options "-O -fdump-ipa-inline" } +// { dg-options "-O -fdump-ipa-inline-all" } class Foo { diff --git a/gcc/testsuite/g++.dg/ipa/imm-devirt-1.C b/gcc/testsuite/g++.dg/ipa/imm-devirt-1.C index 37b7d87..00ac61e7 100644 --- a/gcc/testsuite/g++.dg/ipa/imm-devirt-1.C +++ b/gcc/testsuite/g++.dg/ipa/imm-devirt-1.C @@ -1,7 +1,7 @@ /* Verify that virtual calls are folded even early inlining puts them into one function with the definition. */ /* { dg-do run } */ -/* { dg-options "-O2 -fdump-tree-einline" } */ +/* { dg-options "-O2 -fdump-tree-einline-optimized" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/tree-prof/inline_mismatch_args.C b/gcc/testsuite/g++.dg/tree-prof/inline_mismatch_args.C index 2156cec..b65d915 100644 --- a/gcc/testsuite/g++.dg/tree-prof/inline_mismatch_args.C +++ b/gcc/testsuite/g++.dg/tree-prof/inline_mismatch_args.C @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fdump-tree-einline" } */ +/* { dg-options "-O2 -fdump-tree-einline-all" } */ class DocId { public: DocId() { } diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-1.C b/gcc/testsuite/g++.dg/tree-ssa/inline-1.C index 4497fac..9c49ddb 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/inline-1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/inline-1.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=3" } */ +/* { dg-options "-O2 -fdump-tree-einline-optimized --param max-early-inliner-iterations=3" } */ /* { dg-add-options bind_pic_locally } */ namespace std { diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-2.C b/gcc/testsuite/g++.dg/tree-ssa/inline-2.C index 79f807c..b72f652 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/inline-2.C +++ b/gcc/testsuite/g++.dg/tree-ssa/inline-2.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=3" } */ +/* { dg-options "-O2 -fdump-tree-einline-optimized --param max-early-inliner-iterations=3" } */ /* { dg-add-options bind_pic_locally } */ namespace std { diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-3.C b/gcc/testsuite/g++.dg/tree-ssa/inline-3.C index 0ad366e..131f12d 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/inline-3.C +++ b/gcc/testsuite/g++.dg/tree-ssa/inline-3.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=5" } */ +/* { dg-options "-O2 -fdump-tree-einline-optimized --param max-early-inliner-iterations=5" } */ /* { dg-add-options bind_pic_locally } */ #include diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-4.C b/gcc/testsuite/g++.dg/tree-ssa/inline-4.C new file mode 100644 index 0000000..1dd8140 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/inline-4.C @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopt-info-inline --param max-early-inliner-iterations=3" } */ +/* { dg-add-options bind_pic_locally } */ + +namespace std { + extern "C" int puts(const char *s); +} + +template void +foreach (T b, T e, void (*ptr)(E)) +{ + for (; b != e; b++) + ptr(*b); // { dg-optimized "Inlining void inline_me\[^\\n\]* into int main\[^\\n\]*" } +} + +void +inline_me (char *x) +{ + std::puts(x); +} + +static void +inline_me_too (char *x) +{ + std::puts(x); +} + +int main(int argc, char **argv) +{ + foreach (argv, argv + argc, inline_me); // { dg-optimized "Inlining void foreach\[^\\n\]* into int main\[^\\n\]*" } + foreach (argv, argv + argc, inline_me_too); // { dg-optimized "Inlining void foreach\[^\\n\]* into int main\[^\\n\]*" } +} diff --git a/gcc/testsuite/gcc.dg/ipa/fopt-info-inline-1.c b/gcc/testsuite/gcc.dg/ipa/fopt-info-inline-1.c new file mode 100644 index 0000000..4032ad1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/fopt-info-inline-1.c @@ -0,0 +1,44 @@ +/* { dg-options "-O3 -fopt-info-inline-optimized-missed" } */ + +static int foo (int a) +{ + return a + 10; +} + +static int bar (int b) +{ + return b - 20; +} + +static int boo (int a, int b) +{ + return (foo (a) /* { dg-optimized "Inlining foo/\[0-9\]+ into boo/\[0-9\]+" } */ + + bar (b)); /* { dg-optimized "Inlining bar/\[0-9\]+ into boo/\[0-9\]+" } */ +} + +extern int v_a, v_b; +extern int result; + +int compute () +{ + result = boo (v_a, v_b); /* { dg-optimized "Inlining boo/\[0-9\]+ into compute/\[0-9\]+" } */ + + return result; +} + +extern void not_available(int); + +int __attribute__ ((noinline,noclone)) get_input(void) +{ + return 1; +} + +int test_1 () +{ + return get_input (); /* { dg-missed "not inlinable: test_1/\[0-9\]+ -> get_input/\[0-9\]+, function not inlinable" } */ +} + +void test_2 (int v) +{ + not_available (1); /* { dg-missed "not inlinable: test_2/\[0-9\]+ -> not_available/\[0-9\]+, function body not available" } */ +} diff --git a/gcc/testsuite/gcc.dg/ipa/inline-4.c b/gcc/testsuite/gcc.dg/ipa/inline-4.c index fdb4465..db4cfc6 100644 --- a/gcc/testsuite/gcc.dg/ipa/inline-4.c +++ b/gcc/testsuite/gcc.dg/ipa/inline-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */ +/* { dg-options "-Os -c -fdump-ipa-inline-all -fopt-info-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */ /* { dg-add-options bind_pic_locally } */ void work_hard (void); @@ -20,7 +20,7 @@ void do_something (int shall_i_work) } int foo (int invariant) { - do_something (0); + do_something (0); // { dg-optimized "Inlined do_something/\[0-9]+ into foo/\[0-9]+" } do_something (1); } diff --git a/gcc/testsuite/gcc.dg/ipa/inline-7.c b/gcc/testsuite/gcc.dg/ipa/inline-7.c index 5002aa0..7dabb14 100644 --- a/gcc/testsuite/gcc.dg/ipa/inline-7.c +++ b/gcc/testsuite/gcc.dg/ipa/inline-7.c @@ -1,6 +1,6 @@ /* Check that early inliner works out that a is empty of parameter 0. */ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-einline -fno-partial-inlining" } */ +/* { dg-options "-O2 -fdump-tree-einline-optimized -fopt-info-inline -fno-partial-inlining" } */ void t(void); int a (int b) { @@ -18,7 +18,7 @@ int a (int b) void m() { - a(1); + a(1); /* { dg-optimized "Inlining a/\[0-9\]* into m/\[0-9\]*" } */ a(0); } -/* { dg-final { scan-tree-dump-times "Inlining a into m" 1 "einline" } } */ +/* { dg-final { scan-tree-dump-times "Inlining a.* into m.*" 1 "einline" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c b/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c index 656260a..ecb9a29 100644 --- a/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c +++ b/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c @@ -35,5 +35,5 @@ test (int i) lookup (9 * i); } /* { dg-final { scan-ipa-dump "Wrapper penalty" "inline" } } */ -/* { dg-final { scan-ipa-dump-not "Inlined lookup_slow into lookup" "inline" } } */ -/* { dg-final { scan-ipa-dump "Inlined lookup into test" "inline" } } */ +/* { dg-final { scan-ipa-dump-not "Inlined lookup_slow/\[0-9\]* into lookup/\[0-9\]*" "inline" } } */ +/* { dg-final { scan-ipa-dump "Inlined lookup/\[0-9\]* into test/\[0-9\]*" "inline" } } */ diff --git a/gcc/testsuite/gcc.dg/plugin/dump-1.c b/gcc/testsuite/gcc.dg/plugin/dump-1.c index 95bd7a4..1538bf6 100644 --- a/gcc/testsuite/gcc.dg/plugin/dump-1.c +++ b/gcc/testsuite/gcc.dg/plugin/dump-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fopt-info-note" } */ +/* { dg-options "-fopt-info-loop-note" } */ extern void test_string_literal (void); extern void test_tree (void); diff --git a/gcc/testsuite/gcc.dg/plugin/dump-2.c b/gcc/testsuite/gcc.dg/plugin/dump-2.c index 961a3d3..04b82e5 100644 --- a/gcc/testsuite/gcc.dg/plugin/dump-2.c +++ b/gcc/testsuite/gcc.dg/plugin/dump-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fopt-info-note-internals" } */ +/* { dg-options "-fopt-info-loop-note-internals" } */ extern void test_string_literal (void); extern void test_tree (void); diff --git a/gcc/testsuite/gcc.dg/pr26570.c b/gcc/testsuite/gcc.dg/pr26570.c index 87b644a..d29bc35 100644 --- a/gcc/testsuite/gcc.dg/pr26570.c +++ b/gcc/testsuite/gcc.dg/pr26570.c @@ -6,3 +6,4 @@ unsigned test (unsigned a, unsigned b) { return a / b; } /* { dg-missed "\[^\n\]*execution counts estimated" } */ +/* { dg-prune-output "function body not available" } */ diff --git a/gcc/testsuite/gcc.dg/pr71969-2.c b/gcc/testsuite/gcc.dg/pr71969-2.c index f434fd0..73839a6 100644 --- a/gcc/testsuite/gcc.dg/pr71969-2.c +++ b/gcc/testsuite/gcc.dg/pr71969-2.c @@ -20,4 +20,4 @@ main () return 0; } -/* { dg-final { scan-tree-dump-times "Inlining foo into main" 4 "einline" } } */ +/* { dg-final { scan-tree-dump-times "Inlining foo/\[0-9\]* into main/\[0-9\]*" 4 "einline" } } */ diff --git a/gcc/testsuite/gcc.dg/pr71969-3.c b/gcc/testsuite/gcc.dg/pr71969-3.c index 583d89d..189adfd 100644 --- a/gcc/testsuite/gcc.dg/pr71969-3.c +++ b/gcc/testsuite/gcc.dg/pr71969-3.c @@ -35,4 +35,4 @@ main () } /* { dg-final { scan-tree-dump-times "will not early inline" 8 "einline" } } */ -/* { dg-final { scan-tree-dump-times "Inlining foo into main" 4 "einline" } } */ +/* { dg-final { scan-tree-dump-times "Inlining foo/\[0-9\]* into main/\[0-9\]*" 4 "einline" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c index 6f0ff68..5673c32 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-weak "" } */ -/* { dg-options "-O2 -fdump-tree-einline" } */ +/* { dg-options "-O2 -fdump-tree-einline-all" } */ int w; int bar (void) __attribute__ ((weak)); int bar (){ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c index 2998989..cd441af 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=2" } */ +/* { dg-options "-O2 -fdump-tree-einline-optimized --param max-early-inliner-iterations=2" } */ /* { dg-add-options bind_pic_locally } */ extern void inlined (); @@ -27,5 +27,5 @@ inline_me_too (void) { inlined(); } -/* { dg-final { scan-tree-dump-times "Inlining inline_me " 1 "einline"} } */ -/* { dg-final { scan-tree-dump-times "Inlining inline_me_too " 1 "einline"} } */ +/* { dg-final { scan-tree-dump-times "Inlining inline_me/\[0-9\]* " 1 "einline"} } */ +/* { dg-final { scan-tree-dump-times "Inlining inline_me_too/\[0-9\]* " 1 "einline"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c index c9f7978..93412fa 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-einline" } */ +/* { dg-options "-O2 -fdump-tree-einline-optimized -fopt-info-inline" } */ /* { dg-add-options bind_pic_locally } */ extern int rand(void); @@ -13,7 +13,7 @@ int my_id; int main() { - int res = get_data_for (my_id); + int res = get_data_for (my_id); /* { dg-optimized "Inlining get_data_for/\[0-9\]+ into main/\[0-9\]+." } */ switch (res) { case 0: @@ -23,4 +23,4 @@ int main() } } -/* { dg-final { scan-tree-dump "Inlining get_data_for into main" "einline" } } */ +/* { dg-final { scan-tree-dump "Inlining get_data_for/\[0-9\]* into main/\[0-9\]*" "einline" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c index 6da886e..f87e0b5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -finline-small-functions --param early-inlining-insns=0 -fdump-tree-einline" } */ +/* { dg-options "-O -finline-small-functions --param early-inlining-insns=0 -fdump-tree-einline-optimized" } */ int foo0(); void bar0() { foo0(); } diff --git a/gcc/testsuite/gfortran.dg/pr79966.f90 b/gcc/testsuite/gfortran.dg/pr79966.f90 index eee43fb..2170afd 100644 --- a/gcc/testsuite/gfortran.dg/pr79966.f90 +++ b/gcc/testsuite/gfortran.dg/pr79966.f90 @@ -109,4 +109,4 @@ contains call RunTPTests() end program -! { dg-final { scan-ipa-dump "Inlined tp_sum into runtptests" "inline" } } +! { dg-final { scan-ipa-dump "Inlined tp_sum/\[0-9\]+ into runtptests/\[0-9\]+" "inline" } } diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 297fcd7..5ce319a 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4673,14 +4673,20 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) /* Add local vars in this inlined callee to caller. */ add_local_variables (id->src_cfun, cfun, id); - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_enabled_p ()) { - fprintf (dump_file, "Inlining %s to %s with frequency %4.2f\n", - id->src_node->dump_name (), - id->dst_node->dump_name (), - cg_edge->sreal_frequency ().to_double ()); - id->src_node->dump (dump_file); - id->dst_node->dump (dump_file); + char buf[128]; + snprintf (buf, sizeof(buf), "%4.2f", + cg_edge->sreal_frequency ().to_double ()); + dump_printf_loc (MSG_NOTE | MSG_PRIORITY_INTERNALS, + call_stmt, + "Inlining %C to %C with frequency %s\n", + id->src_node, id->dst_node, buf); + if (dump_file && (dump_flags & TDF_DETAILS)) + { + id->src_node->dump (dump_file); + id->dst_node->dump (dump_file); + } } /* This is it. Duplicate the callee body. Assume callee is -- cgit v1.1 From 0274dd3f8d6bcbc4935fae1e0cc815197c48bb0c Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 8 Nov 2018 15:53:47 +0000 Subject: fe.h (Suppress_Checks): Declare. * fe.h (Suppress_Checks): Declare. * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions only if checks are not suppressed and -faggressive-loop-optimizations only if they are. * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and warned_aggressive_loop_optimizations fields. (gigi): Do not clear warn_aggressive_loop_optimizations here. (Raise_Error_to_gnu): Do not set has_checks. (gnat_to_gnu) : Remove support for aggressive loop optimizations. From-SVN: r265921 --- gcc/ada/ChangeLog | 13 +++++++ gcc/ada/fe.h | 2 ++ gcc/ada/gcc-interface/misc.c | 14 ++++++-- gcc/ada/gcc-interface/trans.c | 51 --------------------------- gcc/testsuite/ChangeLog | 10 ++++++ gcc/testsuite/gnat.dg/null_pointer_deref1.adb | 4 ++- gcc/testsuite/gnat.dg/null_pointer_deref2.adb | 3 +- gcc/testsuite/gnat.dg/null_pointer_deref3.adb | 3 +- gcc/testsuite/gnat.dg/opt74.adb | 13 +++++++ gcc/testsuite/gnat.dg/opt74_pkg.adb | 16 +++++++++ gcc/testsuite/gnat.dg/opt74_pkg.ads | 7 ++++ gcc/testsuite/gnat.dg/warn12.adb | 48 ------------------------- gcc/testsuite/gnat.dg/warn12_pkg.ads | 21 ----------- 13 files changed, 79 insertions(+), 126 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/opt74.adb create mode 100644 gcc/testsuite/gnat.dg/opt74_pkg.adb create mode 100644 gcc/testsuite/gnat.dg/opt74_pkg.ads delete mode 100644 gcc/testsuite/gnat.dg/warn12.adb delete mode 100644 gcc/testsuite/gnat.dg/warn12_pkg.ads diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a1b3c66..ee8ba62 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,18 @@ 2018-11-08 Eric Botcazou + * fe.h (Suppress_Checks): Declare. + * gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions + only if checks are not suppressed and -faggressive-loop-optimizations + only if they are. + * gcc-interface/trans.c (struct loop_info_d): Remove has_checks and + warned_aggressive_loop_optimizations fields. + (gigi): Do not clear warn_aggressive_loop_optimizations here. + (Raise_Error_to_gnu): Do not set has_checks. + (gnat_to_gnu) : Remove support for aggressive + loop optimizations. + +2018-11-08 Eric Botcazou + * gcc-interface/decl.c (components_to_record): Remove obsolete kludge. * gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the new type but do not take into account the setting on the old type for diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index b0ccbdc..d4c4265 100644 --- a/gcc/ada/fe.h +++ b/gcc/ada/fe.h @@ -193,6 +193,7 @@ extern Boolean In_Same_Source_Unit (Node_Id, Node_Id); #define GNAT_Mode opt__gnat_mode #define List_Representation_Info opt__list_representation_info #define No_Strict_Aliasing_CP opt__no_strict_aliasing +#define Suppress_Checks opt__suppress_checks typedef enum { Front_End_SJLJ, Back_End_ZCX, Back_End_SJLJ @@ -207,6 +208,7 @@ extern Boolean Generate_SCO_Instance_Table; extern Boolean GNAT_Mode; extern Int List_Representation_Info; extern Boolean No_Strict_Aliasing_CP; +extern Boolean Suppress_Checks; #define ZCX_Exceptions opt__zcx_exceptions #define SJLJ_Exceptions opt__sjlj_exceptions diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 98ec277..eadbd36 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -392,7 +392,7 @@ gnat_init_gcc_eh (void) using_eh_for_cleanups (); /* Turn on -fexceptions, -fnon-call-exceptions and -fdelete-dead-exceptions. - The first one triggers the generation of the necessary exception tables. + The first one activates the support for exceptions in the compiler. The second one is useful for two reasons: 1/ we map some asynchronous signals like SEGV to exceptions, so we need to ensure that the insns which can lead to such signals are correctly attached to the exception @@ -402,10 +402,18 @@ gnat_init_gcc_eh (void) for such calls to actually raise in Ada. The third one is an optimization that makes it possible to delete dead instructions that may throw exceptions, most notably loads and stores, - as permitted in Ada. */ + as permitted in Ada. + Turn off -faggressive-loop-optimizations because it may optimize away + out-of-bound array accesses that we want to be able to catch. + If checks are disabled, we use the same settings as the C++ compiler. */ flag_exceptions = 1; - flag_non_call_exceptions = 1; flag_delete_dead_exceptions = 1; + if (!Suppress_Checks) + { + flag_non_call_exceptions = 1; + flag_aggressive_loop_optimizations = 0; + warn_aggressive_loop_optimizations = 0; + } init_eh (); } diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index ce2d43f..2cd7102 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -198,8 +198,6 @@ struct GTY(()) loop_info_d { tree high_bound; vec *checks; bool artificial; - bool has_checks; - bool warned_aggressive_loop_optimizations; }; typedef struct loop_info_d *loop_info; @@ -679,10 +677,6 @@ gigi (Node_Id gnat_root, /* Now translate the compilation unit proper. */ Compilation_Unit_to_gnu (gnat_root); - /* Disable -Waggressive-loop-optimizations since we implement our own - version of the warning. */ - warn_aggressive_loop_optimizations = 0; - /* Then process the N_Validate_Unchecked_Conversion nodes. We do this at the very end to avoid having to second-guess the front-end when we run into dummy nodes during the regular processing. */ @@ -5720,7 +5714,6 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) rci->inserted_cond = build1 (SAVE_EXPR, boolean_type_node, boolean_true_node); vec_safe_push (loop->checks, rci); - loop->has_checks = true; gnu_cond = build_noreturn_cond (gnat_to_gnu (gnat_cond)); if (flag_unswitch_loops) gnu_cond = build_binary_op (TRUTH_ANDIF_EXPR, @@ -5733,14 +5726,6 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) gnu_cond, rci->inserted_cond); } - - /* Or else, if aggressive loop optimizations are enabled, we just - record that there are checks applied to iteration variables. */ - else if (optimize - && flag_aggressive_loop_optimizations - && inside_loop_p () - && (loop = find_loop_for (gnu_index))) - loop->has_checks = true; } break; @@ -6359,45 +6344,9 @@ gnat_to_gnu (Node_Id gnat_node) gcc_assert (TREE_CODE (gnu_type) == ARRAY_TYPE); gnat_temp = gnat_expr_array[i]; gnu_expr = maybe_character_value (gnat_to_gnu (gnat_temp)); - struct loop_info_d *loop; gnu_result = build_binary_op (ARRAY_REF, NULL_TREE, gnu_result, gnu_expr); - - /* Array accesses are bound-checked so they cannot trap, but this - is valid only if they are not hoisted ahead of the check. We - need to mark them as no-trap to get decent loop optimizations - in the presence of -fnon-call-exceptions, so we do it when we - know that the original expression had no side-effects. */ - if (TREE_CODE (gnu_result) == ARRAY_REF - && !(Nkind (gnat_temp) == N_Identifier - && Ekind (Entity (gnat_temp)) == E_Constant)) - TREE_THIS_NOTRAP (gnu_result) = 1; - - /* If aggressive loop optimizations are enabled, we warn for loops - overrunning a simple array of size 1 not at the end of a record. - This is aimed to catch misuses of the trailing array idiom. */ - if (optimize - && flag_aggressive_loop_optimizations - && inside_loop_p () - && TREE_CODE (TREE_TYPE (gnu_type)) != ARRAY_TYPE - && TREE_CODE (gnu_array_object) != ARRAY_REF - && tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (gnu_type)), - TYPE_MAX_VALUE (TYPE_DOMAIN (gnu_type))) - && !array_at_struct_end_p (gnu_result) - && (loop = find_loop_for (gnu_expr)) - && !loop->artificial - && !loop->has_checks - && tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (gnu_type)), - loop->low_bound) - && can_be_lower_p (loop->low_bound, loop->high_bound) - && !loop->warned_aggressive_loop_optimizations - && warning (OPT_Waggressive_loop_optimizations, - "out-of-bounds access may be optimized away")) - { - inform (EXPR_LOCATION (loop->stmt), "containing loop"); - loop->warned_aggressive_loop_optimizations = true; - } } gnu_result_type = get_unpadded_type (Etype (gnat_node)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7767ec..e08be59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2018-11-08 Eric Botcazou + + * gnat.dg/null_pointer_deref1.adb: Remove -gnatp and add pragma. + * gnat.dg/null_pointer_deref2.adb: Likewise. + * gnat.dg/null_pointer_deref3.adb: Likewise. + * gnat.dg/opt74.adb: New test. + * gnat.dg/opt74_pkg.ad[sb]: New helper. + * gnat.dg/warn12.adb: Delete. + * gnat.dg/warn12_pkg.ads: Likewise. + 2018-11-08 David Malcolm PR ipa/86395 diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb index ec7f946..0f030b0 100644 --- a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb +++ b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb @@ -1,11 +1,13 @@ -- { dg-do run } --- { dg-options "-gnatp" } -- This test requires architecture- and OS-specific support code for unwinding -- through signal frames (typically located in *-unwind.h) to pass. Feel free -- to disable it if this code hasn't been implemented yet. procedure Null_Pointer_Deref1 is + + pragma Suppress (All_Checks); + type Int_Ptr is access all Integer; function Ident return Int_Ptr is diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb index 2847622..2a4ed09 100644 --- a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb +++ b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb @@ -1,5 +1,4 @@ -- { dg-do run } --- { dg-options "-gnatp" } -- This test requires architecture- and OS-specific support code for unwinding -- through signal frames (typically located in *-unwind.h) to pass. Feel free @@ -7,6 +6,8 @@ procedure Null_Pointer_Deref2 is + pragma Suppress (All_Checks); + task T; task body T is diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref3.adb b/gcc/testsuite/gnat.dg/null_pointer_deref3.adb index f92242e..c8e66a6 100644 --- a/gcc/testsuite/gnat.dg/null_pointer_deref3.adb +++ b/gcc/testsuite/gnat.dg/null_pointer_deref3.adb @@ -1,5 +1,4 @@ -- { dg-do run } --- { dg-options "-O -gnatp" } -- This test requires architecture- and OS-specific support code for unwinding -- through signal frames (typically located in *-unwind.h) to pass. Feel free @@ -7,6 +6,8 @@ procedure Null_Pointer_Deref3 is + pragma Suppress (All_Checks); + procedure Leaf is type Int_Ptr is access all Integer; function n return Int_Ptr is diff --git a/gcc/testsuite/gnat.dg/opt74.adb b/gcc/testsuite/gnat.dg/opt74.adb new file mode 100644 index 0000000..8eacaa5 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt74.adb @@ -0,0 +1,13 @@ +-- { dg-do run } +-- { dg-options "-O2" } + +with Opt74_Pkg; use Opt74_Pkg; + +procedure Opt74 is + Index, Found : Integer; +begin + Proc (Found, Index); + if Found = 1 then + raise Program_Error; + end if; +end; diff --git a/gcc/testsuite/gnat.dg/opt74_pkg.adb b/gcc/testsuite/gnat.dg/opt74_pkg.adb new file mode 100644 index 0000000..4d5ce4f --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt74_pkg.adb @@ -0,0 +1,16 @@ +package body Opt74_Pkg is + + procedure Proc (Found : out Integer; Index : out Integer) is + begin + Index := 1; + Found := 0; + while (Index <= A'Last) and (Found = 0) loop + if A (Index) = 2 then + Found := 1; + else + Index := Index + 1; + end if; + end loop; + end; + +end Opt74_Pkg; diff --git a/gcc/testsuite/gnat.dg/opt74_pkg.ads b/gcc/testsuite/gnat.dg/opt74_pkg.ads new file mode 100644 index 0000000..7c8e85e --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt74_pkg.ads @@ -0,0 +1,7 @@ +package Opt74_Pkg is + + A : array (1 .. 10) of Integer := (others => 0); + + procedure Proc (Found : out Integer; Index : out Integer); + +end Opt74_Pkg; diff --git a/gcc/testsuite/gnat.dg/warn12.adb b/gcc/testsuite/gnat.dg/warn12.adb deleted file mode 100644 index 8ffd0c7..0000000 --- a/gcc/testsuite/gnat.dg/warn12.adb +++ /dev/null @@ -1,48 +0,0 @@ --- { dg-do compile } --- { dg-options "-O2" } - -with Text_IO; use Text_IO; -with System.Storage_Elements; use System.Storage_Elements; -with Warn12_Pkg; use Warn12_Pkg; - -procedure Warn12 (N : Natural) is - - Buffer_Size : constant Storage_Offset - := Token_Groups'Size/System.Storage_Unit + 4096; - - Buffer : Storage_Array (1 .. Buffer_Size); - for Buffer'Alignment use 8; - - Tg1 : Token_Groups; - for Tg1'Address use Buffer'Address; - - Tg2 : Token_Groups; - pragma Warnings (Off, Tg2); - - sid : Sid_And_Attributes; - - pragma Suppress (Index_Check, Sid_And_Attributes_Array); - -begin - - for I in 0 .. 7 loop - sid := Tg1.Groups(I); -- { dg-bogus "out-of-bounds access" } - Put_Line("Iteration"); - end loop; - - for I in 0 .. N loop - sid := Tg1.Groups(I); -- { dg-bogus "out-of-bounds access" } - Put_Line("Iteration"); - end loop; - - for I in 0 .. 7 loop - sid := Tg2.Groups(I); -- { dg-warning "out-of-bounds access" } - Put_Line("Iteration"); - end loop; - - for I in 0 .. N loop - sid := Tg2.Groups(I); -- { dg-warning "out-of-bounds access" } - Put_Line("Iteration"); - end loop; - -end; diff --git a/gcc/testsuite/gnat.dg/warn12_pkg.ads b/gcc/testsuite/gnat.dg/warn12_pkg.ads deleted file mode 100644 index b3191cc..0000000 --- a/gcc/testsuite/gnat.dg/warn12_pkg.ads +++ /dev/null @@ -1,21 +0,0 @@ -with Interfaces.C; use Interfaces.C; -with System; - -package Warn12_Pkg is - - Anysize_Array: constant := 0; - - type Sid_And_Attributes is record - Sid : System.Address; - Attributes : Interfaces.C.Unsigned_Long; - end record; - - type Sid_And_Attributes_Array - is array (Integer range 0..Anysize_Array) of aliased Sid_And_Attributes; - - type Token_Groups is record - GroupCount : Interfaces.C.Unsigned_Long; - Groups : Sid_And_Attributes_Array; - end record; - -end Warn12_Pkg; -- cgit v1.1 From 20ce1f50f6aa20e51580b931ae0c3dc4abbbd458 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Thu, 8 Nov 2018 16:26:00 +0000 Subject: gcc-dg.exp (gcc-dg-prune): Add new regexps for when the size of an output section is too large for a... 2018-11-08 Jozef Lawrynowicz * lib/gcc-dg.exp (gcc-dg-prune): Add new regexps for when the size of an output section is too large for a memory region, or a memory region overflows. From-SVN: r265924 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/lib/gcc-dg.exp | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e08be59..840b3ce 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-11-08 Jozef Lawrynowicz + + * lib/gcc-dg.exp (gcc-dg-prune): Add new regexps for when the size of + an output section is too large for a memory region, or a memory + region overflows. + 2018-11-08 Eric Botcazou * gnat.dg/null_pointer_deref1.adb: Remove -gnatp and add pragma. diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index c33a50c..305dd3c 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -394,6 +394,14 @@ proc gcc-dg-prune { system text } { return "::unsupported::memory full" } + if [regexp "(^|\n)\[^\n\]* section.*will not fit in region" $text] { + return "::unsupported::memory full" + } + + if [regexp "(^|\n)\[^\n\]* region.*overflowed by" $text] { + return "::unsupported::memory full" + } + # Likewise, if we see ".text exceeds local store range" or # similar. if {[string match "spu-*" $system] && \ -- cgit v1.1 From 222cfefa7199b70e62df020c4768840b4434ac7f Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Thu, 8 Nov 2018 16:26:28 +0000 Subject: Update soft-fp from glibc. This patch is updating all soft-fp from glibc, most changes are copyright years update, and changes other than years update are list bellow, this patch has been tested with riscv32-elf(rv32imac), riscv64-elf(rv64imac) and nds32le-elf(v3), didn't introduce new test fail: soft-fp/op-4.h - soft-fp: Use temporary variable in FP_FRAC_SUB_3/FP_FRAC_SUB_4 - ff48ea6787526d7e669af93ce2681b911d39675c soft-fp/op-8.h - soft-fp: Add implementation for 128 bit self-contained - af1d5782c1e3a635fdd13d6688be64de7759857c soft-fp/op-common.h - Add narrowing multiply functions. - 69a01461ee1417578d2ba20aac935828b50f1118 soft-fp/extended.h soft-fp/half.h soft-fp/single.h soft-fp/double.h soft-fp/quad.h - Do not use packed structures in soft-fp. - 049375e2b5fc707436fd5d80337c253beededb2d 2018-11-08 Kito Cheng * soft-fp/adddf3.c: Update from glibc. * soft-fp/addsf3.c: Likewise. * soft-fp/addtf3.c: Likewise. * soft-fp/divdf3.c: Likewise. * soft-fp/divsf3.c: Likewise. * soft-fp/divtf3.c: Likewise. * soft-fp/double.h: Likewise. * soft-fp/eqdf2.c: Likewise. * soft-fp/eqsf2.c: Likewise. * soft-fp/eqtf2.c: Likewise. * soft-fp/extenddftf2.c: Likewise. * soft-fp/extended.h: Likewise. * soft-fp/extendhftf2.c: Likewise. * soft-fp/extendsfdf2.c: Likewise. * soft-fp/extendsftf2.c: Likewise. * soft-fp/extendxftf2.c: Likewise. * soft-fp/fixdfdi.c: Likewise. * soft-fp/fixdfsi.c: Likewise. * soft-fp/fixdfti.c: Likewise. * soft-fp/fixhfti.c: Likewise. * soft-fp/fixsfdi.c: Likewise. * soft-fp/fixsfsi.c: Likewise. * soft-fp/fixsfti.c: Likewise. * soft-fp/fixtfdi.c: Likewise. * soft-fp/fixtfsi.c: Likewise. * soft-fp/fixtfti.c: Likewise. * soft-fp/fixunsdfdi.c: Likewise. * soft-fp/fixunsdfsi.c: Likewise. * soft-fp/fixunsdfti.c: Likewise. * soft-fp/fixunshfti.c: Likewise. * soft-fp/fixunssfdi.c: Likewise. * soft-fp/fixunssfsi.c: Likewise. * soft-fp/fixunssfti.c: Likewise. * soft-fp/fixunstfdi.c: Likewise. * soft-fp/fixunstfsi.c: Likewise. * soft-fp/fixunstfti.c: Likewise. * soft-fp/floatdidf.c: Likewise. * soft-fp/floatdisf.c: Likewise. * soft-fp/floatditf.c: Likewise. * soft-fp/floatsidf.c: Likewise. * soft-fp/floatsisf.c: Likewise. * soft-fp/floatsitf.c: Likewise. * soft-fp/floattidf.c: Likewise. * soft-fp/floattihf.c: Likewise. * soft-fp/floattisf.c: Likewise. * soft-fp/floattitf.c: Likewise. * soft-fp/floatundidf.c: Likewise. * soft-fp/floatundisf.c: Likewise. * soft-fp/floatunditf.c: Likewise. * soft-fp/floatunsidf.c: Likewise. * soft-fp/floatunsisf.c: Likewise. * soft-fp/floatunsitf.c: Likewise. * soft-fp/floatuntidf.c: Likewise. * soft-fp/floatuntihf.c: Likewise. * soft-fp/floatuntisf.c: Likewise. * soft-fp/floatuntitf.c: Likewise. * soft-fp/gedf2.c: Likewise. * soft-fp/gesf2.c: Likewise. * soft-fp/getf2.c: Likewise. * soft-fp/half.h: Likewise. * soft-fp/ledf2.c: Likewise. * soft-fp/lesf2.c: Likewise. * soft-fp/letf2.c: Likewise. * soft-fp/muldf3.c: Likewise. * soft-fp/mulsf3.c: Likewise. * soft-fp/multf3.c: Likewise. * soft-fp/negdf2.c: Likewise. * soft-fp/negsf2.c: Likewise. * soft-fp/negtf2.c: Likewise. * soft-fp/op-1.h: Likewise. * soft-fp/op-2.h: Likewise. * soft-fp/op-4.h: Likewise. * soft-fp/op-8.h: Likewise. * soft-fp/op-common.h: Likewise. * soft-fp/quad.h: Likewise. * soft-fp/single.h: Likewise. * soft-fp/soft-fp.h: Likewise. * soft-fp/subdf3.c: Likewise. * soft-fp/subsf3.c: Likewise. * soft-fp/subtf3.c: Likewise. * soft-fp/truncdfsf2.c: Likewise. * soft-fp/trunctfdf2.c: Likewise. * soft-fp/trunctfhf2.c: Likewise. * soft-fp/trunctfsf2.c: Likewise. * soft-fp/trunctfxf2.c: Likewise. * soft-fp/unorddf2.c: Likewise. * soft-fp/unordsf2.c: Likewise. * soft-fp/unordtf2.c: Likewise. From-SVN: r265925 --- libgcc/ChangeLog | 91 ++++++++++++++++++++++++++++++++++++++++++++ libgcc/soft-fp/adddf3.c | 2 +- libgcc/soft-fp/addsf3.c | 2 +- libgcc/soft-fp/addtf3.c | 2 +- libgcc/soft-fp/divdf3.c | 2 +- libgcc/soft-fp/divsf3.c | 2 +- libgcc/soft-fp/divtf3.c | 2 +- libgcc/soft-fp/double.h | 6 +-- libgcc/soft-fp/eqdf2.c | 2 +- libgcc/soft-fp/eqsf2.c | 2 +- libgcc/soft-fp/eqtf2.c | 2 +- libgcc/soft-fp/extenddftf2.c | 2 +- libgcc/soft-fp/extended.h | 4 +- libgcc/soft-fp/extendhftf2.c | 2 +- libgcc/soft-fp/extendsfdf2.c | 2 +- libgcc/soft-fp/extendsftf2.c | 2 +- libgcc/soft-fp/extendxftf2.c | 2 +- libgcc/soft-fp/fixdfdi.c | 2 +- libgcc/soft-fp/fixdfsi.c | 2 +- libgcc/soft-fp/fixdfti.c | 2 +- libgcc/soft-fp/fixhfti.c | 2 +- libgcc/soft-fp/fixsfdi.c | 2 +- libgcc/soft-fp/fixsfsi.c | 2 +- libgcc/soft-fp/fixsfti.c | 2 +- libgcc/soft-fp/fixtfdi.c | 2 +- libgcc/soft-fp/fixtfsi.c | 2 +- libgcc/soft-fp/fixtfti.c | 2 +- libgcc/soft-fp/fixunsdfdi.c | 2 +- libgcc/soft-fp/fixunsdfsi.c | 2 +- libgcc/soft-fp/fixunsdfti.c | 2 +- libgcc/soft-fp/fixunshfti.c | 2 +- libgcc/soft-fp/fixunssfdi.c | 2 +- libgcc/soft-fp/fixunssfsi.c | 2 +- libgcc/soft-fp/fixunssfti.c | 2 +- libgcc/soft-fp/fixunstfdi.c | 2 +- libgcc/soft-fp/fixunstfsi.c | 2 +- libgcc/soft-fp/fixunstfti.c | 2 +- libgcc/soft-fp/floatdidf.c | 2 +- libgcc/soft-fp/floatdisf.c | 2 +- libgcc/soft-fp/floatditf.c | 2 +- libgcc/soft-fp/floatsidf.c | 2 +- libgcc/soft-fp/floatsisf.c | 2 +- libgcc/soft-fp/floatsitf.c | 2 +- libgcc/soft-fp/floattidf.c | 2 +- libgcc/soft-fp/floattihf.c | 2 +- libgcc/soft-fp/floattisf.c | 2 +- libgcc/soft-fp/floattitf.c | 2 +- libgcc/soft-fp/floatundidf.c | 2 +- libgcc/soft-fp/floatundisf.c | 2 +- libgcc/soft-fp/floatunditf.c | 2 +- libgcc/soft-fp/floatunsidf.c | 2 +- libgcc/soft-fp/floatunsisf.c | 2 +- libgcc/soft-fp/floatunsitf.c | 2 +- libgcc/soft-fp/floatuntidf.c | 2 +- libgcc/soft-fp/floatuntihf.c | 2 +- libgcc/soft-fp/floatuntisf.c | 2 +- libgcc/soft-fp/floatuntitf.c | 2 +- libgcc/soft-fp/gedf2.c | 2 +- libgcc/soft-fp/gesf2.c | 2 +- libgcc/soft-fp/getf2.c | 2 +- libgcc/soft-fp/half.h | 4 +- libgcc/soft-fp/ledf2.c | 2 +- libgcc/soft-fp/lesf2.c | 2 +- libgcc/soft-fp/letf2.c | 2 +- libgcc/soft-fp/muldf3.c | 2 +- libgcc/soft-fp/mulsf3.c | 2 +- libgcc/soft-fp/multf3.c | 2 +- libgcc/soft-fp/negdf2.c | 2 +- libgcc/soft-fp/negsf2.c | 2 +- libgcc/soft-fp/negtf2.c | 2 +- libgcc/soft-fp/op-1.h | 2 +- libgcc/soft-fp/op-2.h | 2 +- libgcc/soft-fp/op-4.h | 65 +++++++++++++++++-------------- libgcc/soft-fp/op-8.h | 90 ++++++++++++++++++++++++++++++++++++++++++- libgcc/soft-fp/op-common.h | 23 ++++++++++- libgcc/soft-fp/quad.h | 4 +- libgcc/soft-fp/single.h | 4 +- libgcc/soft-fp/soft-fp.h | 2 +- libgcc/soft-fp/subdf3.c | 2 +- libgcc/soft-fp/subsf3.c | 2 +- libgcc/soft-fp/subtf3.c | 2 +- libgcc/soft-fp/truncdfsf2.c | 2 +- libgcc/soft-fp/trunctfdf2.c | 2 +- libgcc/soft-fp/trunctfhf2.c | 2 +- libgcc/soft-fp/trunctfsf2.c | 2 +- libgcc/soft-fp/trunctfxf2.c | 2 +- libgcc/soft-fp/unorddf2.c | 2 +- libgcc/soft-fp/unordsf2.c | 2 +- libgcc/soft-fp/unordtf2.c | 2 +- 89 files changed, 329 insertions(+), 122 deletions(-) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 72f24d2..de81188 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,94 @@ +2018-11-08 Kito Cheng + + * soft-fp/adddf3.c: Update from glibc. + * soft-fp/addsf3.c: Likewise. + * soft-fp/addtf3.c: Likewise. + * soft-fp/divdf3.c: Likewise. + * soft-fp/divsf3.c: Likewise. + * soft-fp/divtf3.c: Likewise. + * soft-fp/double.h: Likewise. + * soft-fp/eqdf2.c: Likewise. + * soft-fp/eqsf2.c: Likewise. + * soft-fp/eqtf2.c: Likewise. + * soft-fp/extenddftf2.c: Likewise. + * soft-fp/extended.h: Likewise. + * soft-fp/extendhftf2.c: Likewise. + * soft-fp/extendsfdf2.c: Likewise. + * soft-fp/extendsftf2.c: Likewise. + * soft-fp/extendxftf2.c: Likewise. + * soft-fp/fixdfdi.c: Likewise. + * soft-fp/fixdfsi.c: Likewise. + * soft-fp/fixdfti.c: Likewise. + * soft-fp/fixhfti.c: Likewise. + * soft-fp/fixsfdi.c: Likewise. + * soft-fp/fixsfsi.c: Likewise. + * soft-fp/fixsfti.c: Likewise. + * soft-fp/fixtfdi.c: Likewise. + * soft-fp/fixtfsi.c: Likewise. + * soft-fp/fixtfti.c: Likewise. + * soft-fp/fixunsdfdi.c: Likewise. + * soft-fp/fixunsdfsi.c: Likewise. + * soft-fp/fixunsdfti.c: Likewise. + * soft-fp/fixunshfti.c: Likewise. + * soft-fp/fixunssfdi.c: Likewise. + * soft-fp/fixunssfsi.c: Likewise. + * soft-fp/fixunssfti.c: Likewise. + * soft-fp/fixunstfdi.c: Likewise. + * soft-fp/fixunstfsi.c: Likewise. + * soft-fp/fixunstfti.c: Likewise. + * soft-fp/floatdidf.c: Likewise. + * soft-fp/floatdisf.c: Likewise. + * soft-fp/floatditf.c: Likewise. + * soft-fp/floatsidf.c: Likewise. + * soft-fp/floatsisf.c: Likewise. + * soft-fp/floatsitf.c: Likewise. + * soft-fp/floattidf.c: Likewise. + * soft-fp/floattihf.c: Likewise. + * soft-fp/floattisf.c: Likewise. + * soft-fp/floattitf.c: Likewise. + * soft-fp/floatundidf.c: Likewise. + * soft-fp/floatundisf.c: Likewise. + * soft-fp/floatunditf.c: Likewise. + * soft-fp/floatunsidf.c: Likewise. + * soft-fp/floatunsisf.c: Likewise. + * soft-fp/floatunsitf.c: Likewise. + * soft-fp/floatuntidf.c: Likewise. + * soft-fp/floatuntihf.c: Likewise. + * soft-fp/floatuntisf.c: Likewise. + * soft-fp/floatuntitf.c: Likewise. + * soft-fp/gedf2.c: Likewise. + * soft-fp/gesf2.c: Likewise. + * soft-fp/getf2.c: Likewise. + * soft-fp/half.h: Likewise. + * soft-fp/ledf2.c: Likewise. + * soft-fp/lesf2.c: Likewise. + * soft-fp/letf2.c: Likewise. + * soft-fp/muldf3.c: Likewise. + * soft-fp/mulsf3.c: Likewise. + * soft-fp/multf3.c: Likewise. + * soft-fp/negdf2.c: Likewise. + * soft-fp/negsf2.c: Likewise. + * soft-fp/negtf2.c: Likewise. + * soft-fp/op-1.h: Likewise. + * soft-fp/op-2.h: Likewise. + * soft-fp/op-4.h: Likewise. + * soft-fp/op-8.h: Likewise. + * soft-fp/op-common.h: Likewise. + * soft-fp/quad.h: Likewise. + * soft-fp/single.h: Likewise. + * soft-fp/soft-fp.h: Likewise. + * soft-fp/subdf3.c: Likewise. + * soft-fp/subsf3.c: Likewise. + * soft-fp/subtf3.c: Likewise. + * soft-fp/truncdfsf2.c: Likewise. + * soft-fp/trunctfdf2.c: Likewise. + * soft-fp/trunctfhf2.c: Likewise. + * soft-fp/trunctfsf2.c: Likewise. + * soft-fp/trunctfxf2.c: Likewise. + * soft-fp/unorddf2.c: Likewise. + * soft-fp/unordsf2.c: Likewise. + * soft-fp/unordtf2.c: Likewise. + 2018-11-04 Venkataramanan Kumar * config/i386/cpuinfo.c: (get_amd_cpu): Add znver2. diff --git a/libgcc/soft-fp/adddf3.c b/libgcc/soft-fp/adddf3.c index 358b38d..993790f 100644 --- a/libgcc/soft-fp/adddf3.c +++ b/libgcc/soft-fp/adddf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/addsf3.c b/libgcc/soft-fp/addsf3.c index 0135b3d..ae16ae2 100644 --- a/libgcc/soft-fp/addsf3.c +++ b/libgcc/soft-fp/addsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/addtf3.c b/libgcc/soft-fp/addtf3.c index 13cee71..905f913 100644 --- a/libgcc/soft-fp/addtf3.c +++ b/libgcc/soft-fp/addtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a + b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/divdf3.c b/libgcc/soft-fp/divdf3.c index ded0ad0..703e141 100644 --- a/libgcc/soft-fp/divdf3.c +++ b/libgcc/soft-fp/divdf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/divsf3.c b/libgcc/soft-fp/divsf3.c index 46fe9ad..282cbf1 100644 --- a/libgcc/soft-fp/divsf3.c +++ b/libgcc/soft-fp/divsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/divtf3.c b/libgcc/soft-fp/divtf3.c index e03889c..885c70e 100644 --- a/libgcc/soft-fp/divtf3.c +++ b/libgcc/soft-fp/divtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a / b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/double.h b/libgcc/soft-fp/double.h index 88d4bd7..23d11cc 100644 --- a/libgcc/soft-fp/double.h +++ b/libgcc/soft-fp/double.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Double Precision - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -89,7 +89,7 @@ union _FP_UNION_D unsigned exp : _FP_EXPBITS_D; unsigned sign : 1; # endif - } bits __attribute__ ((packed)); + } bits; }; # define FP_DECL_D(X) _FP_DECL (2, X) @@ -210,7 +210,7 @@ union _FP_UNION_D unsigned exp : _FP_EXPBITS_D; unsigned sign : 1; # endif - } bits __attribute__ ((packed)); + } bits; }; # define FP_DECL_D(X) _FP_DECL (1, X) diff --git a/libgcc/soft-fp/eqdf2.c b/libgcc/soft-fp/eqdf2.c index 951f86d..5bc9b52 100644 --- a/libgcc/soft-fp/eqdf2.c +++ b/libgcc/soft-fp/eqdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/eqsf2.c b/libgcc/soft-fp/eqsf2.c index 89bdc36..0d87f95 100644 --- a/libgcc/soft-fp/eqsf2.c +++ b/libgcc/soft-fp/eqsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/eqtf2.c b/libgcc/soft-fp/eqtf2.c index f91720e..5766685 100644 --- a/libgcc/soft-fp/eqtf2.c +++ b/libgcc/soft-fp/eqtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 otherwise - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/extenddftf2.c b/libgcc/soft-fp/extenddftf2.c index 94e5527..31c7263 100644 --- a/libgcc/soft-fp/extenddftf2.c +++ b/libgcc/soft-fp/extenddftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/extended.h b/libgcc/soft-fp/extended.h index 7b19e83..d279432 100644 --- a/libgcc/soft-fp/extended.h +++ b/libgcc/soft-fp/extended.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Extended Precision. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek (jj@ultra.linux.cz). @@ -88,7 +88,7 @@ union _FP_UNION_E unsigned exp : _FP_EXPBITS_E; unsigned sign : 1; # endif /* not bigendian */ - } bits __attribute__ ((packed)); + } bits; }; diff --git a/libgcc/soft-fp/extendhftf2.c b/libgcc/soft-fp/extendhftf2.c index 6ff6438..7f1f89e 100644 --- a/libgcc/soft-fp/extendhftf2.c +++ b/libgcc/soft-fp/extendhftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return an IEEE half converted to IEEE quad - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/extendsfdf2.c b/libgcc/soft-fp/extendsfdf2.c index 221584c..6baab11 100644 --- a/libgcc/soft-fp/extendsfdf2.c +++ b/libgcc/soft-fp/extendsfdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE double - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/extendsftf2.c b/libgcc/soft-fp/extendsftf2.c index 6eab3a6..e3f2e95 100644 --- a/libgcc/soft-fp/extendsftf2.c +++ b/libgcc/soft-fp/extendsftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/extendxftf2.c b/libgcc/soft-fp/extendxftf2.c index 1975d67..2d12da1 100644 --- a/libgcc/soft-fp/extendxftf2.c +++ b/libgcc/soft-fp/extendxftf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a converted to IEEE quad - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixdfdi.c b/libgcc/soft-fp/fixdfdi.c index d697fc4..e29139d 100644 --- a/libgcc/soft-fp/fixdfdi.c +++ b/libgcc/soft-fp/fixdfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixdfsi.c b/libgcc/soft-fp/fixdfsi.c index 3e312aa..9bce678 100644 --- a/libgcc/soft-fp/fixdfsi.c +++ b/libgcc/soft-fp/fixdfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixdfti.c b/libgcc/soft-fp/fixdfti.c index 07d7a82..ef31b16 100644 --- a/libgcc/soft-fp/fixdfti.c +++ b/libgcc/soft-fp/fixdfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE double to 128bit signed integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixhfti.c b/libgcc/soft-fp/fixhfti.c index 3610f4c..76e5166 100644 --- a/libgcc/soft-fp/fixhfti.c +++ b/libgcc/soft-fp/fixhfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE half to 128bit signed integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/fixsfdi.c b/libgcc/soft-fp/fixsfdi.c index cd37e8e..d90ec6e 100644 --- a/libgcc/soft-fp/fixsfdi.c +++ b/libgcc/soft-fp/fixsfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixsfsi.c b/libgcc/soft-fp/fixsfsi.c index 6417bd4..367f68b 100644 --- a/libgcc/soft-fp/fixsfsi.c +++ b/libgcc/soft-fp/fixsfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixsfti.c b/libgcc/soft-fp/fixsfti.c index 0ff3b9a..bfe861a 100644 --- a/libgcc/soft-fp/fixsfti.c +++ b/libgcc/soft-fp/fixsfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE single to 128bit signed integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixtfdi.c b/libgcc/soft-fp/fixtfdi.c index 1ea4ad9..7ea934d 100644 --- a/libgcc/soft-fp/fixtfdi.c +++ b/libgcc/soft-fp/fixtfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit signed integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixtfsi.c b/libgcc/soft-fp/fixtfsi.c index e4f8be1..f71f1d5 100644 --- a/libgcc/soft-fp/fixtfsi.c +++ b/libgcc/soft-fp/fixtfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit signed integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixtfti.c b/libgcc/soft-fp/fixtfti.c index d4aceba..7dd97b4 100644 --- a/libgcc/soft-fp/fixtfti.c +++ b/libgcc/soft-fp/fixtfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE quad to 128bit signed integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixunsdfdi.c b/libgcc/soft-fp/fixunsdfdi.c index 5ae4c2c..d66df51 100644 --- a/libgcc/soft-fp/fixunsdfdi.c +++ b/libgcc/soft-fp/fixunsdfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunsdfsi.c b/libgcc/soft-fp/fixunsdfsi.c index 96bf6db..0367fe1 100644 --- a/libgcc/soft-fp/fixunsdfsi.c +++ b/libgcc/soft-fp/fixunsdfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunsdfti.c b/libgcc/soft-fp/fixunsdfti.c index 9423341..ffa7c20 100644 --- a/libgcc/soft-fp/fixunsdfti.c +++ b/libgcc/soft-fp/fixunsdfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE double to 128bit unsigned integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixunshfti.c b/libgcc/soft-fp/fixunshfti.c index 30edbfe..81aee89 100644 --- a/libgcc/soft-fp/fixunshfti.c +++ b/libgcc/soft-fp/fixunshfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE half to 128bit unsigned integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/fixunssfdi.c b/libgcc/soft-fp/fixunssfdi.c index fe8a3fa..9e6851f 100644 --- a/libgcc/soft-fp/fixunssfdi.c +++ b/libgcc/soft-fp/fixunssfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunssfsi.c b/libgcc/soft-fp/fixunssfsi.c index bd40ba2..c1940e8 100644 --- a/libgcc/soft-fp/fixunssfsi.c +++ b/libgcc/soft-fp/fixunssfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunssfti.c b/libgcc/soft-fp/fixunssfti.c index e630ac3..22b0705 100644 --- a/libgcc/soft-fp/fixunssfti.c +++ b/libgcc/soft-fp/fixunssfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE single to 128bit unsigned integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/fixunstfdi.c b/libgcc/soft-fp/fixunstfdi.c index 788cbe4..453fa3d 100644 --- a/libgcc/soft-fp/fixunstfdi.c +++ b/libgcc/soft-fp/fixunstfdi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 64bit unsigned integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunstfsi.c b/libgcc/soft-fp/fixunstfsi.c index 25d6f58..b808146 100644 --- a/libgcc/soft-fp/fixunstfsi.c +++ b/libgcc/soft-fp/fixunstfsi.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a to 32bit unsigned integer - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/fixunstfti.c b/libgcc/soft-fp/fixunstfti.c index f4dd876..13653b0 100644 --- a/libgcc/soft-fp/fixunstfti.c +++ b/libgcc/soft-fp/fixunstfti.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert IEEE quad to 128bit unsigned integer - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatdidf.c b/libgcc/soft-fp/floatdidf.c index afd31d3..a8601f3 100644 --- a/libgcc/soft-fp/floatdidf.c +++ b/libgcc/soft-fp/floatdidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE double - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatdisf.c b/libgcc/soft-fp/floatdisf.c index 30e2c712..efc2bda 100644 --- a/libgcc/soft-fp/floatdisf.c +++ b/libgcc/soft-fp/floatdisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE single - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatditf.c b/libgcc/soft-fp/floatditf.c index dd088d5..e98b3fe 100644 --- a/libgcc/soft-fp/floatditf.c +++ b/libgcc/soft-fp/floatditf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit signed integer to IEEE quad - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatsidf.c b/libgcc/soft-fp/floatsidf.c index a9b0a71..d37f680 100644 --- a/libgcc/soft-fp/floatsidf.c +++ b/libgcc/soft-fp/floatsidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE double - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatsisf.c b/libgcc/soft-fp/floatsisf.c index 5196818..f9b5975 100644 --- a/libgcc/soft-fp/floatsisf.c +++ b/libgcc/soft-fp/floatsisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE single - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatsitf.c b/libgcc/soft-fp/floatsitf.c index 42f950f..07ea026 100644 --- a/libgcc/soft-fp/floatsitf.c +++ b/libgcc/soft-fp/floatsitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit signed integer to IEEE quad - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floattidf.c b/libgcc/soft-fp/floattidf.c index fdc6133..b5d0396 100644 --- a/libgcc/soft-fp/floattidf.c +++ b/libgcc/soft-fp/floattidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE double - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floattihf.c b/libgcc/soft-fp/floattihf.c index 74ac83a..fdc4e84 100644 --- a/libgcc/soft-fp/floattihf.c +++ b/libgcc/soft-fp/floattihf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE half - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/floattisf.c b/libgcc/soft-fp/floattisf.c index bc173e9..619e6f9 100644 --- a/libgcc/soft-fp/floattisf.c +++ b/libgcc/soft-fp/floattisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE single - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floattitf.c b/libgcc/soft-fp/floattitf.c index f2bf410..78319a2 100644 --- a/libgcc/soft-fp/floattitf.c +++ b/libgcc/soft-fp/floattitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit signed integer to IEEE quad - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatundidf.c b/libgcc/soft-fp/floatundidf.c index 093d594..85b6fc7 100644 --- a/libgcc/soft-fp/floatundidf.c +++ b/libgcc/soft-fp/floatundidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit unsigned integer to IEEE double - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatundisf.c b/libgcc/soft-fp/floatundisf.c index 56fa9da..8896ebc 100644 --- a/libgcc/soft-fp/floatundisf.c +++ b/libgcc/soft-fp/floatundisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit unsigned integer to IEEE single - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunditf.c b/libgcc/soft-fp/floatunditf.c index 106d06e..d1c1ca9 100644 --- a/libgcc/soft-fp/floatunditf.c +++ b/libgcc/soft-fp/floatunditf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 64bit unsigned integer to IEEE quad - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunsidf.c b/libgcc/soft-fp/floatunsidf.c index b116695..a28f298 100644 --- a/libgcc/soft-fp/floatunsidf.c +++ b/libgcc/soft-fp/floatunsidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit unsigned integer to IEEE double - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunsisf.c b/libgcc/soft-fp/floatunsisf.c index fc2a6d6..8cede27 100644 --- a/libgcc/soft-fp/floatunsisf.c +++ b/libgcc/soft-fp/floatunsisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit unsigned integer to IEEE single - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatunsitf.c b/libgcc/soft-fp/floatunsitf.c index 000423d9..671755f 100644 --- a/libgcc/soft-fp/floatunsitf.c +++ b/libgcc/soft-fp/floatunsitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 32bit unsigned integer to IEEE quad - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/floatuntidf.c b/libgcc/soft-fp/floatuntidf.c index 0236bd5..8b1eff7 100644 --- a/libgcc/soft-fp/floatuntidf.c +++ b/libgcc/soft-fp/floatuntidf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE double - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatuntihf.c b/libgcc/soft-fp/floatuntihf.c index 90e77c2..34700d9 100644 --- a/libgcc/soft-fp/floatuntihf.c +++ b/libgcc/soft-fp/floatuntihf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE half. - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/floatuntisf.c b/libgcc/soft-fp/floatuntisf.c index e4b9531..4b61820 100644 --- a/libgcc/soft-fp/floatuntisf.c +++ b/libgcc/soft-fp/floatuntisf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE single - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/floatuntitf.c b/libgcc/soft-fp/floatuntitf.c index 69727e5..13cd873 100644 --- a/libgcc/soft-fp/floatuntitf.c +++ b/libgcc/soft-fp/floatuntitf.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Convert a 128bit unsigned integer to IEEE quad - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/gedf2.c b/libgcc/soft-fp/gedf2.c index f466cc9..840c9fb 100644 --- a/libgcc/soft-fp/gedf2.c +++ b/libgcc/soft-fp/gedf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/gesf2.c b/libgcc/soft-fp/gesf2.c index 2e516e5..7a3ae25 100644 --- a/libgcc/soft-fp/gesf2.c +++ b/libgcc/soft-fp/gesf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/getf2.c b/libgcc/soft-fp/getf2.c index e302629..f418de2 100644 --- a/libgcc/soft-fp/getf2.c +++ b/libgcc/soft-fp/getf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/half.h b/libgcc/soft-fp/half.h index ba75297..a1fea7b 100644 --- a/libgcc/soft-fp/half.h +++ b/libgcc/soft-fp/half.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Half Precision. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -75,7 +75,7 @@ union _FP_UNION_H unsigned exp : _FP_EXPBITS_H; unsigned sign : 1; #endif - } bits __attribute__ ((packed)); + } bits; }; #define FP_DECL_H(X) _FP_DECL (1, X) diff --git a/libgcc/soft-fp/ledf2.c b/libgcc/soft-fp/ledf2.c index 2f4d698..b323b8e 100644 --- a/libgcc/soft-fp/ledf2.c +++ b/libgcc/soft-fp/ledf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/lesf2.c b/libgcc/soft-fp/lesf2.c index 67aa9c8..2c96c23 100644 --- a/libgcc/soft-fp/lesf2.c +++ b/libgcc/soft-fp/lesf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/letf2.c b/libgcc/soft-fp/letf2.c index 4a56305..7e7b244 100644 --- a/libgcc/soft-fp/letf2.c +++ b/libgcc/soft-fp/letf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/muldf3.c b/libgcc/soft-fp/muldf3.c index 644e810..b2df20c 100644 --- a/libgcc/soft-fp/muldf3.c +++ b/libgcc/soft-fp/muldf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/mulsf3.c b/libgcc/soft-fp/mulsf3.c index e551331..6c5c44e 100644 --- a/libgcc/soft-fp/mulsf3.c +++ b/libgcc/soft-fp/mulsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/multf3.c b/libgcc/soft-fp/multf3.c index baab377..75971c6 100644 --- a/libgcc/soft-fp/multf3.c +++ b/libgcc/soft-fp/multf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a * b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/negdf2.c b/libgcc/soft-fp/negdf2.c index a4b2dea..f6fe2727 100644 --- a/libgcc/soft-fp/negdf2.c +++ b/libgcc/soft-fp/negdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/negsf2.c b/libgcc/soft-fp/negsf2.c index 825b76f..1ce0090 100644 --- a/libgcc/soft-fp/negsf2.c +++ b/libgcc/soft-fp/negsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/negtf2.c b/libgcc/soft-fp/negtf2.c index 892c923..3b7f27c 100644 --- a/libgcc/soft-fp/negtf2.c +++ b/libgcc/soft-fp/negtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return -a - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/op-1.h b/libgcc/soft-fp/op-1.h index b4d611d..bafa7f4 100644 --- a/libgcc/soft-fp/op-1.h +++ b/libgcc/soft-fp/op-1.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic one-word fraction declaration and manipulation. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/op-2.h b/libgcc/soft-fp/op-2.h index 5c5f4fc..6020d66 100644 --- a/libgcc/soft-fp/op-2.h +++ b/libgcc/soft-fp/op-2.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic two-word fraction declaration and manipulation. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/op-4.h b/libgcc/soft-fp/op-4.h index b2df519..b429801 100644 --- a/libgcc/soft-fp/op-4.h +++ b/libgcc/soft-fp/op-4.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic four-word fraction declaration and manipulation. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -696,39 +696,46 @@ #endif #ifndef __FP_FRAC_SUB_3 -# define __FP_FRAC_SUB_3(r2, r1, r0, x2, x1, x0, y2, y1, y0) \ - do \ - { \ - _FP_W_TYPE __FP_FRAC_SUB_3_c1, __FP_FRAC_SUB_3_c2; \ - r0 = x0 - y0; \ - __FP_FRAC_SUB_3_c1 = r0 > x0; \ - r1 = x1 - y1; \ - __FP_FRAC_SUB_3_c2 = r1 > x1; \ - r1 -= __FP_FRAC_SUB_3_c1; \ - __FP_FRAC_SUB_3_c2 |= __FP_FRAC_SUB_3_c1 && (y1 == x1); \ - r2 = x2 - y2 - __FP_FRAC_SUB_3_c2; \ - } \ +# define __FP_FRAC_SUB_3(r2, r1, r0, x2, x1, x0, y2, y1, y0) \ + do \ + { \ + _FP_W_TYPE __FP_FRAC_SUB_3_tmp[2]; \ + _FP_W_TYPE __FP_FRAC_SUB_3_c1, __FP_FRAC_SUB_3_c2; \ + __FP_FRAC_SUB_3_tmp[0] = x0 - y0; \ + __FP_FRAC_SUB_3_c1 = __FP_FRAC_SUB_3_tmp[0] > x0; \ + __FP_FRAC_SUB_3_tmp[1] = x1 - y1; \ + __FP_FRAC_SUB_3_c2 = __FP_FRAC_SUB_3_tmp[1] > x1; \ + __FP_FRAC_SUB_3_tmp[1] -= __FP_FRAC_SUB_3_c1; \ + __FP_FRAC_SUB_3_c2 |= __FP_FRAC_SUB_3_c1 && (y1 == x1); \ + r2 = x2 - y2 - __FP_FRAC_SUB_3_c2; \ + r1 = __FP_FRAC_SUB_3_tmp[1]; \ + r0 = __FP_FRAC_SUB_3_tmp[0]; \ + } \ while (0) #endif #ifndef __FP_FRAC_SUB_4 # define __FP_FRAC_SUB_4(r3, r2, r1, r0, x3, x2, x1, x0, y3, y2, y1, y0) \ - do \ - { \ - _FP_W_TYPE __FP_FRAC_SUB_4_c1, __FP_FRAC_SUB_4_c2; \ - _FP_W_TYPE __FP_FRAC_SUB_4_c3; \ - r0 = x0 - y0; \ - __FP_FRAC_SUB_4_c1 = r0 > x0; \ - r1 = x1 - y1; \ - __FP_FRAC_SUB_4_c2 = r1 > x1; \ - r1 -= __FP_FRAC_SUB_4_c1; \ - __FP_FRAC_SUB_4_c2 |= __FP_FRAC_SUB_4_c1 && (y1 == x1); \ - r2 = x2 - y2; \ - __FP_FRAC_SUB_4_c3 = r2 > x2; \ - r2 -= __FP_FRAC_SUB_4_c2; \ - __FP_FRAC_SUB_4_c3 |= __FP_FRAC_SUB_4_c2 && (y2 == x2); \ - r3 = x3 - y3 - __FP_FRAC_SUB_4_c3; \ - } \ + do \ + { \ + _FP_W_TYPE __FP_FRAC_SUB_4_tmp[3]; \ + _FP_W_TYPE __FP_FRAC_SUB_4_c1, __FP_FRAC_SUB_4_c2; \ + _FP_W_TYPE __FP_FRAC_SUB_4_c3; \ + __FP_FRAC_SUB_4_tmp[0] = x0 - y0; \ + __FP_FRAC_SUB_4_c1 = __FP_FRAC_SUB_4_tmp[0] > x0; \ + __FP_FRAC_SUB_4_tmp[1] = x1 - y1; \ + __FP_FRAC_SUB_4_c2 = __FP_FRAC_SUB_4_tmp[1] > x1; \ + __FP_FRAC_SUB_4_tmp[1] -= __FP_FRAC_SUB_4_c1; \ + __FP_FRAC_SUB_4_c2 |= __FP_FRAC_SUB_4_c1 && (y1 == x1); \ + __FP_FRAC_SUB_4_tmp[2] = x2 - y2; \ + __FP_FRAC_SUB_4_c3 = __FP_FRAC_SUB_4_tmp[2] > x2; \ + __FP_FRAC_SUB_4_tmp[2] -= __FP_FRAC_SUB_4_c2; \ + __FP_FRAC_SUB_4_c3 |= __FP_FRAC_SUB_4_c2 && (y2 == x2); \ + r3 = x3 - y3 - __FP_FRAC_SUB_4_c3; \ + r2 = __FP_FRAC_SUB_4_tmp[2]; \ + r1 = __FP_FRAC_SUB_4_tmp[1]; \ + r0 = __FP_FRAC_SUB_4_tmp[0]; \ + } \ while (0) #endif diff --git a/libgcc/soft-fp/op-8.h b/libgcc/soft-fp/op-8.h index 6b63c22..4871c49 100644 --- a/libgcc/soft-fp/op-8.h +++ b/libgcc/soft-fp/op-8.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Basic eight-word fraction declaration and manipulation. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz) and @@ -35,6 +35,7 @@ /* We need just a few things from here for op-4, if we ever need some other macros, they can be added. */ #define _FP_FRAC_DECL_8(X) _FP_W_TYPE X##_f[8] +#define _FP_FRAC_SET_8(X, I) __FP_FRAC_SET_8 (X, I) #define _FP_FRAC_HIGH_8(X) (X##_f[7]) #define _FP_FRAC_LOW_8(X) (X##_f[0]) #define _FP_FRAC_WORD_8(X, w) (X##_f[w]) @@ -147,4 +148,91 @@ } \ while (0) +#define _FP_FRAC_ADD_8(R, X, Y) \ + do \ + { \ + _FP_W_TYPE _FP_FRAC_ADD_8_c = 0; \ + _FP_I_TYPE _FP_FRAC_ADD_8_i; \ + for (_FP_FRAC_ADD_8_i = 0; _FP_FRAC_ADD_8_i < 8; ++_FP_FRAC_ADD_8_i) \ + { \ + R##_f[_FP_FRAC_ADD_8_i] \ + = (X##_f[_FP_FRAC_ADD_8_i] + Y##_f[_FP_FRAC_ADD_8_i] \ + + _FP_FRAC_ADD_8_c); \ + _FP_FRAC_ADD_8_c \ + = (_FP_FRAC_ADD_8_c \ + ? R##_f[_FP_FRAC_ADD_8_i] <= X##_f[_FP_FRAC_ADD_8_i] \ + : R##_f[_FP_FRAC_ADD_8_i] < X##_f[_FP_FRAC_ADD_8_i]); \ + } \ + } \ + while (0) + +#define _FP_FRAC_SUB_8(R, X, Y) \ + do \ + { \ + _FP_W_TYPE _FP_FRAC_SUB_8_tmp[8]; \ + _FP_W_TYPE _FP_FRAC_SUB_8_c = 0; \ + _FP_I_TYPE _FP_FRAC_SUB_8_i; \ + for (_FP_FRAC_SUB_8_i = 0; _FP_FRAC_SUB_8_i < 8; ++_FP_FRAC_SUB_8_i) \ + { \ + _FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i] \ + = (X##_f[_FP_FRAC_SUB_8_i] - Y##_f[_FP_FRAC_SUB_8_i] \ + - _FP_FRAC_SUB_8_c); \ + _FP_FRAC_SUB_8_c \ + = (_FP_FRAC_SUB_8_c \ + ? (_FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i] \ + >= X##_f[_FP_FRAC_SUB_8_i]) \ + : (_FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i] \ + > X##_f[_FP_FRAC_SUB_8_i])); \ + } \ + for (_FP_FRAC_SUB_8_i = 0; _FP_FRAC_SUB_8_i < 8; ++_FP_FRAC_SUB_8_i) \ + R##_f[_FP_FRAC_SUB_8_i] = _FP_FRAC_SUB_8_tmp[_FP_FRAC_SUB_8_i]; \ + } \ + while (0) + +#define _FP_FRAC_CLZ_8(R, X) \ + do \ + { \ + _FP_I_TYPE _FP_FRAC_CLZ_8_i; \ + for (_FP_FRAC_CLZ_8_i = 7; _FP_FRAC_CLZ_8_i > 0; _FP_FRAC_CLZ_8_i--) \ + if (X##_f[_FP_FRAC_CLZ_8_i]) \ + break; \ + __FP_CLZ ((R), X##_f[_FP_FRAC_CLZ_8_i]); \ + (R) += _FP_W_TYPE_SIZE * (7 - _FP_FRAC_CLZ_8_i); \ + } \ + while (0) + +#define _FP_MINFRAC_8 0, 0, 0, 0, 0, 0, 0, 1 + +#define _FP_FRAC_NEGP_8(X) ((_FP_WS_TYPE) X##_f[7] < 0) +#define _FP_FRAC_ZEROP_8(X) \ + ((X##_f[0] | X##_f[1] | X##_f[2] | X##_f[3] \ + | X##_f[4] | X##_f[5] | X##_f[6] | X##_f[7]) == 0) +#define _FP_FRAC_HIGHBIT_DW_8(fs, X) \ + (_FP_FRAC_HIGH_DW_##fs (X) & _FP_HIGHBIT_DW_##fs) + +#define _FP_FRAC_COPY_4_8(D, S) \ + do \ + { \ + D##_f[0] = S##_f[0]; \ + D##_f[1] = S##_f[1]; \ + D##_f[2] = S##_f[2]; \ + D##_f[3] = S##_f[3]; \ + } \ + while (0) + +#define _FP_FRAC_COPY_8_4(D, S) \ + do \ + { \ + D##_f[0] = S##_f[0]; \ + D##_f[1] = S##_f[1]; \ + D##_f[2] = S##_f[2]; \ + D##_f[3] = S##_f[3]; \ + D##_f[4] = D##_f[5] = D##_f[6] = D##_f[7]= 0; \ + } \ + while (0) + +#define __FP_FRAC_SET_8(X, I7, I6, I5, I4, I3, I2, I1, I0) \ + (X##_f[7] = I7, X##_f[6] = I6, X##_f[5] = I5, X##_f[4] = I4, \ + X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0) + #endif /* !SOFT_FP_OP_8_H */ diff --git a/libgcc/soft-fp/op-common.h b/libgcc/soft-fp/op-common.h index f52194e..d6f32ae 100644 --- a/libgcc/soft-fp/op-common.h +++ b/libgcc/soft-fp/op-common.h @@ -1,5 +1,5 @@ /* Software floating-point emulation. Common operations. - Copyright (C) 1997-2017 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -2041,6 +2041,27 @@ } \ while (0) +/* Truncate from a wider floating-point format to a narrower one. + Input and output are cooked. */ +#define FP_TRUNC_COOKED(dfs, sfs, dwc, swc, D, S) \ + do \ + { \ + _FP_STATIC_ASSERT (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \ + "destination mantissa wider than source"); \ + if (S##_c == FP_CLS_NAN) \ + _FP_FRAC_SRL_##swc (S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs)); \ + else \ + _FP_FRAC_SRS_##swc (S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs), \ + _FP_WFRACBITS_##sfs); \ + _FP_FRAC_COPY_##dwc##_##swc (D, S); \ + D##_e = S##_e; \ + D##_c = S##_c; \ + D##_s = S##_s; \ + } \ + while (0) + /* Helper primitives. */ /* Count leading zeros in a word. */ diff --git a/libgcc/soft-fp/quad.h b/libgcc/soft-fp/quad.h index a09b95f..9a9e4e7 100644 --- a/libgcc/soft-fp/quad.h +++ b/libgcc/soft-fp/quad.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Quad Precision. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -93,7 +93,7 @@ union _FP_UNION_Q unsigned exp : _FP_EXPBITS_Q; unsigned sign : 1; # endif /* not bigendian */ - } bits __attribute__ ((packed)); + } bits; }; diff --git a/libgcc/soft-fp/single.h b/libgcc/soft-fp/single.h index 42691a8..d5c4a6d 100644 --- a/libgcc/soft-fp/single.h +++ b/libgcc/soft-fp/single.h @@ -1,6 +1,6 @@ /* Software floating-point emulation. Definitions for IEEE Single Precision. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), @@ -82,7 +82,7 @@ union _FP_UNION_S unsigned exp : _FP_EXPBITS_S; unsigned sign : 1; #endif - } bits __attribute__ ((packed)); + } bits; }; #define FP_DECL_S(X) _FP_DECL (1, X) diff --git a/libgcc/soft-fp/soft-fp.h b/libgcc/soft-fp/soft-fp.h index 7fe3ae3..a7a0133 100644 --- a/libgcc/soft-fp/soft-fp.h +++ b/libgcc/soft-fp/soft-fp.h @@ -1,5 +1,5 @@ /* Software floating-point emulation. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com), Jakub Jelinek (jj@ultra.linux.cz), diff --git a/libgcc/soft-fp/subdf3.c b/libgcc/soft-fp/subdf3.c index 1c31629..10035f4 100644 --- a/libgcc/soft-fp/subdf3.c +++ b/libgcc/soft-fp/subdf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/subsf3.c b/libgcc/soft-fp/subsf3.c index 0a81916..b0ecd7c 100644 --- a/libgcc/soft-fp/subsf3.c +++ b/libgcc/soft-fp/subsf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/subtf3.c b/libgcc/soft-fp/subtf3.c index 6a93fce..090f4af 100644 --- a/libgcc/soft-fp/subtf3.c +++ b/libgcc/soft-fp/subtf3.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return a - b - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/truncdfsf2.c b/libgcc/soft-fp/truncdfsf2.c index 4c757f5..4db07c5 100644 --- a/libgcc/soft-fp/truncdfsf2.c +++ b/libgcc/soft-fp/truncdfsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE double into IEEE single - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/trunctfdf2.c b/libgcc/soft-fp/trunctfdf2.c index 837267f..c0d1d34 100644 --- a/libgcc/soft-fp/trunctfdf2.c +++ b/libgcc/soft-fp/trunctfdf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE double - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/trunctfhf2.c b/libgcc/soft-fp/trunctfhf2.c index 0500b14..8eddd14 100644 --- a/libgcc/soft-fp/trunctfhf2.c +++ b/libgcc/soft-fp/trunctfhf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE half. - Copyright (C) 1997-2015 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/libgcc/soft-fp/trunctfsf2.c b/libgcc/soft-fp/trunctfsf2.c index 8cf829e..4b04d69 100644 --- a/libgcc/soft-fp/trunctfsf2.c +++ b/libgcc/soft-fp/trunctfsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE single - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). diff --git a/libgcc/soft-fp/trunctfxf2.c b/libgcc/soft-fp/trunctfxf2.c index db411d0..391de24 100644 --- a/libgcc/soft-fp/trunctfxf2.c +++ b/libgcc/soft-fp/trunctfxf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Truncate IEEE quad into IEEE extended - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Uros Bizjak (ubizjak@gmail.com). diff --git a/libgcc/soft-fp/unorddf2.c b/libgcc/soft-fp/unorddf2.c index ffdbc6b..c11066a 100644 --- a/libgcc/soft-fp/unorddf2.c +++ b/libgcc/soft-fp/unorddf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 iff a or b is a NaN, 0 otherwise. - Copyright (C) 2006-2016 Free Software Foundation, Inc. + Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Joseph Myers (joseph@codesourcery.com). diff --git a/libgcc/soft-fp/unordsf2.c b/libgcc/soft-fp/unordsf2.c index e3f3bd9..b262e18 100644 --- a/libgcc/soft-fp/unordsf2.c +++ b/libgcc/soft-fp/unordsf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 iff a or b is a NaN, 0 otherwise. - Copyright (C) 2006-2016 Free Software Foundation, Inc. + Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Joseph Myers (joseph@codesourcery.com). diff --git a/libgcc/soft-fp/unordtf2.c b/libgcc/soft-fp/unordtf2.c index dd75985..3d0abe5 100644 --- a/libgcc/soft-fp/unordtf2.c +++ b/libgcc/soft-fp/unordtf2.c @@ -1,6 +1,6 @@ /* Software floating-point emulation. Return 1 iff a or b is a NaN, 0 otherwise. - Copyright (C) 2006-2016 Free Software Foundation, Inc. + Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Joseph Myers (joseph@codesourcery.com). -- cgit v1.1 From 3bf37b1d4fab3eabb5ade034ddff791743ee3838 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Thu, 8 Nov 2018 16:29:01 +0000 Subject: pr27336.c: Skip test if the target keeps null pointer checks. 2018-11-08 Jozef Lawrynowicz * c-c++-common/pr27336.c: Skip test if the target keeps null pointer checks. * gcc.dg/addr_equal-1.c: Likewise. * gcc.dg/tree-ssa/pr78154.c: Likewise. * gcc.dg/tree-ssa/vrp111.c: Likewise. From-SVN: r265926 --- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/c-c++-common/pr27336.c | 1 + gcc/testsuite/gcc.dg/addr_equal-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr78154.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/vrp111.c | 1 + 5 files changed, 12 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 840b3ce..77e7e64 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,13 @@ 2018-11-08 Jozef Lawrynowicz + * c-c++-common/pr27336.c: Skip test if the target keeps null pointer + checks. + * gcc.dg/addr_equal-1.c: Likewise. + * gcc.dg/tree-ssa/pr78154.c: Likewise. + * gcc.dg/tree-ssa/vrp111.c: Likewise. + +2018-11-08 Jozef Lawrynowicz + * lib/gcc-dg.exp (gcc-dg-prune): Add new regexps for when the size of an output section is too large for a memory region, or a memory region overflows. diff --git a/gcc/testsuite/c-c++-common/pr27336.c b/gcc/testsuite/c-c++-common/pr27336.c index ce68559..4ecc232 100644 --- a/gcc/testsuite/c-c++-common/pr27336.c +++ b/gcc/testsuite/c-c++-common/pr27336.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdelete-null-pointer-checks -fdump-tree-vrp1" } */ +/* { dg-skip-if "" { keeps_null_pointer_checks } } */ struct B { int x; }; extern void g3(struct B *that) __attribute__((nonnull)); diff --git a/gcc/testsuite/gcc.dg/addr_equal-1.c b/gcc/testsuite/gcc.dg/addr_equal-1.c index 70fa354..18b0dc9 100644 --- a/gcc/testsuite/gcc.dg/addr_equal-1.c +++ b/gcc/testsuite/gcc.dg/addr_equal-1.c @@ -4,6 +4,7 @@ /* { dg-require-alias "" } */ /* { dg-options "-O2 -fdelete-null-pointer-checks" } */ /* { dg-skip-if "" { powerpc-ibm-aix* } } */ +/* { dg-skip-if "function pointers can be NULL" { keeps_null_pointer_checks } } */ void abort (void); extern int undef_var0, undef_var1; extern __attribute__ ((weak)) int weak_undef_var0; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr78154.c b/gcc/testsuite/gcc.dg/tree-ssa/pr78154.c index b561503..3ba8f64 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr78154.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr78154.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-evrp-slim -fdelete-null-pointer-checks" } */ +/* { dg-skip-if "" { keeps_null_pointer_checks } } */ void f(void *d, const void *s, __SIZE_TYPE__ n) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp111.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp111.c index 6314423..cae2bc7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp111.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp111.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-evrp -fdelete-null-pointer-checks" } */ +/* { dg-skip-if "" { keeps_null_pointer_checks } } */ void foo (void *p) __attribute__((nonnull(1))); -- cgit v1.1 From 270819b84ba7323c5d855984c2fa3b2fb71e7767 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Thu, 8 Nov 2018 16:31:27 +0000 Subject: patchable_function_entry-decl.c: Add regex to search for uppercase "NOP" instructions in assembler output. 2018-11-08 Jozef Lawrynowicz * c-c++-common/patchable_function_entry-decl.c: Add regex to search for uppercase "NOP" instructions in assembler output. * c-c++-common/patchable_function_entry-default.c: Likewise. * c-c++-common/patchable_function_entry-definition.c: Likewise. From-SVN: r265927 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/c-c++-common/patchable_function_entry-decl.c | 2 +- gcc/testsuite/c-c++-common/patchable_function_entry-default.c | 2 +- gcc/testsuite/c-c++-common/patchable_function_entry-definition.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 77e7e64..6caf9ba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2018-11-08 Jozef Lawrynowicz + * c-c++-common/patchable_function_entry-decl.c: Add regex to search for + uppercase "NOP" instructions in assembler output. + * c-c++-common/patchable_function_entry-default.c: Likewise. + * c-c++-common/patchable_function_entry-definition.c: Likewise. + +2018-11-08 Jozef Lawrynowicz + * c-c++-common/pr27336.c: Skip test if the target keeps null pointer checks. * gcc.dg/addr_equal-1.c: Likewise. diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c index 32e2c06..3bfb756 100644 --- a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c +++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c @@ -1,6 +1,6 @@ /* { dg-do compile { target { ! nvptx*-*-* } } } */ /* { dg-options "-O2 -fpatchable-function-entry=3,1" } */ -/* { dg-final { scan-assembler-times "nop" 2 { target { ! { alpha*-*-* visium-*-* } } } } } */ +/* { dg-final { scan-assembler-times "nop|NOP" 2 { target { ! { alpha*-*-* visium-*-* } } } } } */ /* { dg-final { scan-assembler-times "bis" 2 { target alpha*-*-* } } } */ /* { dg-final { scan-assembler-times "nop" 3 { target visium-*-* } } } */ diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c index be88e43..bd7c6e9 100644 --- a/gcc/testsuite/c-c++-common/patchable_function_entry-default.c +++ b/gcc/testsuite/c-c++-common/patchable_function_entry-default.c @@ -1,6 +1,6 @@ /* { dg-do compile { target { ! nvptx*-*-* } } } */ /* { dg-options "-O2 -fpatchable-function-entry=3,1" } */ -/* { dg-final { scan-assembler-times "nop" 3 { target { ! { alpha*-*-* visium-*-* } } } } } */ +/* { dg-final { scan-assembler-times "nop|NOP" 3 { target { ! { alpha*-*-* visium-*-* } } } } } */ /* { dg-final { scan-assembler-times "bis" 3 { target alpha*-*-* } } } */ /* { dg-final { scan-assembler-times "nop" 4 { target visium-*-* } } } */ diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c index af18dbc..7091138 100644 --- a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c +++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c @@ -1,6 +1,6 @@ /* { dg-do compile { target { ! nvptx*-*-* } } } */ /* { dg-options "-O2 -fpatchable-function-entry=3,1" } */ -/* { dg-final { scan-assembler-times "nop" 1 { target { ! { alpha*-*-* visium-*-* } } } } } */ +/* { dg-final { scan-assembler-times "nop|NOP" 1 { target { ! { alpha*-*-* visium-*-* } } } } } */ /* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */ /* { dg-final { scan-assembler-times "nop" 2 { target visium-*-* } } } */ -- cgit v1.1 From d0cb40577fb3a4cbdadd96c5454d1cfdfb64b518 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Thu, 8 Nov 2018 16:35:21 +0000 Subject: attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent integer overflow when... 2018-11-08 Jozef Lawrynowicz * gcc.dg/attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent integer overflow when sizeof(short) == sizeof(int). * gcc.dg/attr-alloc_size-11.c: Likewise. * gcc.dg/attr-alloc_size-3.c: Likewise. * gcc.dg/attr-alloc_size-5.c: Likewise. * gcc.dg/builtin-stringop-chk-7.c: Likewise. From-SVN: r265928 --- gcc/testsuite/ChangeLog | 9 +++++++++ gcc/testsuite/gcc.dg/attr-alloc_size-10.c | 2 +- gcc/testsuite/gcc.dg/attr-alloc_size-11.c | 2 +- gcc/testsuite/gcc.dg/attr-alloc_size-3.c | 2 +- gcc/testsuite/gcc.dg/attr-alloc_size-5.c | 2 +- gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6caf9ba..57f2367 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,14 @@ 2018-11-08 Jozef Lawrynowicz + * gcc.dg/attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent + integer overflow when sizeof(short) == sizeof(int). + * gcc.dg/attr-alloc_size-11.c: Likewise. + * gcc.dg/attr-alloc_size-3.c: Likewise. + * gcc.dg/attr-alloc_size-5.c: Likewise. + * gcc.dg/builtin-stringop-chk-7.c: Likewise. + +2018-11-08 Jozef Lawrynowicz + * c-c++-common/patchable_function_entry-decl.c: Add regex to search for uppercase "NOP" instructions in assembler output. * c-c++-common/patchable_function_entry-default.c: Likewise. diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-10.c b/gcc/testsuite/gcc.dg/attr-alloc_size-10.c index 4080717..071c6aa 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-10.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-10.c @@ -13,7 +13,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c index 301a06f..7f2fc49 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c @@ -11,7 +11,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-3.c b/gcc/testsuite/gcc.dg/attr-alloc_size-3.c index 96ff077..7e8c22f 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-3.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-3.c @@ -14,7 +14,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-5.c b/gcc/testsuite/gcc.dg/attr-alloc_size-5.c index f9884ed..26ee43f 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-5.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-5.c @@ -12,7 +12,7 @@ #define SHRT_MAX __SHRT_MAX__ #define SHRT_MIN (-SHRT_MAX - 1) -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define INT_MIN (-INT_MAX - 1) diff --git a/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c b/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c index 173e4ff..d3908a2 100644 --- a/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c +++ b/gcc/testsuite/gcc.dg/builtin-stringop-chk-7.c @@ -9,7 +9,7 @@ #define UCHAR_MAX (SCHAR_MAX * 2 + 1) #define SHRT_MAX __SHRT_MAX__ -#define USHRT_MAX (SHRT_MAX * 2 + 1) +#define USHRT_MAX (SHRT_MAX * 2U + 1) #define INT_MAX __INT_MAX__ #define UINT_MAX (INT_MAX * 2U + 1) -- cgit v1.1 From dfe2a550e8879f9af11e8e2c7c4eb10ea626a7e6 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 8 Nov 2018 18:06:24 +0100 Subject: pr87874.c (em): Declare uint64_max as const unsigned long long int. * gcc.dg/pr87874.c (em): Declare uint64_max as const unsigned long long int. From-SVN: r265929 --- gcc/testsuite/ChangeLog | 7 ++++++- gcc/testsuite/gcc.dg/pr87874.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 57f2367..5d24473 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-08 Uros Bizjak + + * gcc.dg/pr87874.c (em): Declare uint64_max as + const unsigned long long int. + 2018-11-08 Jozef Lawrynowicz * gcc.dg/attr-alloc_size-10.c: Fix calculation of USHRT_MAX to prevent @@ -24,7 +29,7 @@ 2018-11-08 Jozef Lawrynowicz - * lib/gcc-dg.exp (gcc-dg-prune): Add new regexps for when the size of + * lib/gcc-dg.exp (gcc-dg-prune): Add new regexps for when the size of an output section is too large for a memory region, or a memory region overflows. diff --git a/gcc/testsuite/gcc.dg/pr87874.c b/gcc/testsuite/gcc.dg/pr87874.c index 1480a5e..80debe0 100644 --- a/gcc/testsuite/gcc.dg/pr87874.c +++ b/gcc/testsuite/gcc.dg/pr87874.c @@ -16,7 +16,7 @@ em (int u5, int fo, int s7) if (es == 0) if (nb == *vk) { - const unsigned long int uint64_max = 18446744073709551615ul; + const unsigned long long int uint64_max = 18446744073709551615ull; __int128 ks = uint64_max / 2 + 1; while (s7 < 1) -- cgit v1.1