diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/fortran/error.c | 12 | ||||
-rw-r--r-- | gcc/fortran/trans-io.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr79886.f90 | 17 | ||||
-rw-r--r-- | gcc/tree-diagnostic.c | 2 | ||||
-rw-r--r-- | gcc/tree-diagnostic.h | 3 |
8 files changed, 55 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4def3a5..ee94c4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-16 Jakub Jelinek <jakub@redhat.com> + + PR fortran/79886 + * tree-diagnostic.c (default_tree_printer): No longer static. + * tree-diagnostic.h (default_tree_printer): New prototype. + 2017-03-16 Tamar Christina <tamar.christina@arm.com> * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8629cab..b617d45 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,13 @@ +2017-03-16 Jakub Jelinek <jakub@redhat.com> + + PR fortran/79886 + * error.c (gfc_format_decoder): Rename plus argument to set_locus, + remove ATTRIBUTE_UNUSED from all arguments, call default_tree_printer + if not a Fortran specific spec. + * trans-io.c: Include options.h. + (gfc_build_st_parameter): Temporarily disable -Wpadded around layout + of artificial IO data structures. + 2017-03-15 David Malcolm <dmalcolm@redhat.com> PR fortran/79860 diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c index ccf0be0..0312499 100644 --- a/gcc/fortran/error.c +++ b/gcc/fortran/error.c @@ -916,10 +916,8 @@ gfc_notify_std (int std, const char *gmsgid, ...) %L Takes locus argument */ static bool -gfc_format_decoder (pretty_printer *pp, - text_info *text, const char *spec, - int precision ATTRIBUTE_UNUSED, bool wide ATTRIBUTE_UNUSED, - bool plus ATTRIBUTE_UNUSED, bool hash ATTRIBUTE_UNUSED) +gfc_format_decoder (pretty_printer *pp, text_info *text, const char *spec, + int precision, bool wide, bool set_locus, bool hash) { switch (*spec) { @@ -946,7 +944,11 @@ gfc_format_decoder (pretty_printer *pp, return true; } default: - return false; + /* Fall through info the middle-end decoder, as e.g. stor-layout.c + etc. diagnostics can use the FE printer while the FE is still + active. */ + return default_tree_printer (pp, text, spec, precision, wide, + set_locus, hash); } } diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index fbbad46..36e84be 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "trans-array.h" #include "trans-types.h" #include "trans-const.h" +#include "options.h" /* Members of the ioparm structure. */ @@ -219,7 +220,12 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types) gcc_unreachable (); } + /* -Wpadded warnings on these artificially created structures are not + helpful; suppress them. */ + int save_warn_padded = warn_padded; + warn_padded = 0; gfc_finish_type (t); + warn_padded = save_warn_padded; st_parameter[ptype].type = t; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3ca7b5f..2fbdeb5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-16 Jakub Jelinek <jakub@redhat.com> + + PR fortran/79886 + * gfortran.dg/pr79886.f90: New test. + 2017-03-15 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/79038 diff --git a/gcc/testsuite/gfortran.dg/pr79886.f90 b/gcc/testsuite/gfortran.dg/pr79886.f90 new file mode 100644 index 0000000..a62cd18 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr79886.f90 @@ -0,0 +1,17 @@ +! PR fortran/79886 +! { dg-do compile } +! { dg-options "-Wpadded" } + +subroutine pr79886 + type :: foo + integer (kind=1) :: a + integer (kind=8) :: b ! { dg-warning "padding struct to align" } + integer (kind=1) :: c + integer (kind=8) :: d ! { dg-warning "padding struct to align" } + end type + type (foo) :: f + f%a = 1 + f%b = 2 + f%c = 3 + f%d = 4 +end subroutine diff --git a/gcc/tree-diagnostic.c b/gcc/tree-diagnostic.c index 7edea0e..4f211ed 100644 --- a/gcc/tree-diagnostic.c +++ b/gcc/tree-diagnostic.c @@ -243,7 +243,7 @@ virt_loc_aware_diagnostic_finalizer (diagnostic_context *context, } /* Default tree printer. Handles declarations only. */ -static bool +bool default_tree_printer (pretty_printer *pp, text_info *text, const char *spec, int precision, bool wide, bool set_locus, bool hash) { diff --git a/gcc/tree-diagnostic.h b/gcc/tree-diagnostic.h index 0110944..e95183f 100644 --- a/gcc/tree-diagnostic.h +++ b/gcc/tree-diagnostic.h @@ -54,4 +54,7 @@ void virt_loc_aware_diagnostic_finalizer (diagnostic_context *, diagnostic_info *); void tree_diagnostics_defaults (diagnostic_context *context); +bool default_tree_printer (pretty_printer *, text_info *, const char *, + int, bool, bool, bool); + #endif /* ! GCC_TREE_DIAGNOSTIC_H */ |