Commit c05c2380 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/79886 (ICE in pp_format, at pretty-print.c:681)

	PR fortran/79886
	* tree-diagnostic.c (default_tree_printer): No longer static.
	* tree-diagnostic.h (default_tree_printer): New prototype.
fortran/
	* 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.
testsuite/
	* gfortran.dg/pr79886.f90: New test.

From-SVN: r246203
parent a4c687d6
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>)
......
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
......
......@@ -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);
}
}
......
......@@ -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;
}
......
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
......
! 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
......@@ -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)
{
......
......@@ -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 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment