aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-const.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2018-02-23 12:35:30 +0000
committerPaul Thomas <pault@gcc.gnu.org>2018-02-23 12:35:30 +0000
commitc287dea0c4a9319979288995e449c09184528a2f (patch)
tree20538aa6bca7ab6acae0f29f303b513cdb7ec7b5 /gcc/fortran/trans-const.c
parent99b4a565262c5755bf2bebe17ff852abdebb08a9 (diff)
downloadgcc-c287dea0c4a9319979288995e449c09184528a2f.zip
gcc-c287dea0c4a9319979288995e449c09184528a2f.tar.gz
gcc-c287dea0c4a9319979288995e449c09184528a2f.tar.bz2
re PR fortran/83148 (ICE: crash_signal from toplev.c:325)
2018-02-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/83148 * trans-const.c : Clean up some whitespace issues. * trans-expr.c (gfc_conv_initializer): If an iso_c_binding derived type has a kind value of zero, set it to the default integer kind. 2018-02-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/83148 * gfortran.dg/class_68.f90: New test. From-SVN: r257930
Diffstat (limited to 'gcc/fortran/trans-const.c')
-rw-r--r--gcc/fortran/trans-const.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 07950dc..6b4e0de43 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -133,7 +133,7 @@ gfc_build_localized_cstring_const (const char *msgid)
/* Return a string constant with the given length. Used for static
- initializers. The constant will be padded or truncated to match
+ initializers. The constant will be padded or truncated to match
length. */
tree
@@ -303,7 +303,7 @@ gfc_conv_constant_to_tree (gfc_expr * expr)
/* If it is has a prescribed memory representation, we build a string
constant and VIEW_CONVERT to its type. */
-
+
switch (expr->ts.type)
{
case BT_INTEGER:
@@ -389,12 +389,12 @@ gfc_conv_constant (gfc_se * se, gfc_expr * expr)
if (expr->ts.type == BT_DERIVED && expr->ts.u.derived
&& expr->ts.u.derived->attr.is_iso_c)
{
- if (expr->symtree->n.sym->intmod_sym_id == ISOCBINDING_NULL_PTR
- || expr->symtree->n.sym->intmod_sym_id == ISOCBINDING_NULL_FUNPTR)
- {
- /* Create a new EXPR_CONSTANT expression for our local uses. */
- expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0);
- }
+ if (expr->symtree->n.sym->intmod_sym_id == ISOCBINDING_NULL_PTR
+ || expr->symtree->n.sym->intmod_sym_id == ISOCBINDING_NULL_FUNPTR)
+ {
+ /* Create a new EXPR_CONSTANT expression for our local uses. */
+ expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, 0);
+ }
}
if (expr->expr_type != EXPR_CONSTANT)