Magellan Linux

Annotation of /trunk/gcc/patches/gcc-5.2.0-gfortran-ice-segfault.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2629 - (hide annotations) (download)
Mon Jul 20 09:41:31 2015 UTC (8 years, 11 months ago) by niro
File size: 1709 byte(s)
-fix a gfortran regression
1 niro 2629 --- a/gcc/fortran/trans-expr.c
2     +++ a/gcc/fortran/trans-expr.c
3     @@ -6897,6 +6897,30 @@ alloc_scalar_allocatable_for_subcomponent_assignment (stmtblock_t *block,
4     TREE_TYPE (tmp), tmp,
5     fold_convert (TREE_TYPE (tmp), size));
6     }
7     + else if (cm->ts.type == BT_CLASS)
8     + {
9     + gcc_assert (expr2->ts.type == BT_CLASS || expr2->ts.type == BT_DERIVED);
10     + if (expr2->ts.type == BT_DERIVED)
11     + {
12     + tmp = gfc_get_symbol_decl (gfc_find_vtab (&expr2->ts));
13     + tmp = gfc_build_addr_expr (NULL_TREE, tmp);
14     + size = fold_convert (size_type_node, gfc_vptr_size_get (tmp));
15     + }
16     + else
17     + {
18     + gfc_expr *e2vtab;
19     + gfc_se se;
20     + e2vtab = gfc_find_and_cut_at_last_class_ref (expr2);
21     + gfc_add_vptr_component (e2vtab);
22     + gfc_add_size_component (e2vtab);
23     + gfc_init_se (&se, NULL);
24     + gfc_conv_expr (&se, e2vtab);
25     + gfc_add_block_to_block (block, &se.pre);
26     + size = fold_convert (size_type_node, se.expr);
27     + gfc_free_expr (e2vtab);
28     + }
29     + size_in_bytes = size;
30     + }
31     else
32     {
33     /* Otherwise use the length in bytes of the rhs. */
34     @@ -7068,6 +7092,14 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr,
35     tmp = gfc_build_memcpy_call (tmp, se.expr, size);
36     gfc_add_expr_to_block (&block, tmp);
37     }
38     + else if (cm->ts.type == BT_CLASS && expr->ts.type == BT_CLASS)
39     + {
40     + tmp = gfc_copy_class_to_class (se.expr, dest, integer_one_node,
41     + CLASS_DATA (cm)->attr.unlimited_polymorphic);
42     + gfc_add_expr_to_block (&block, tmp);
43     + gfc_add_modify (&block, gfc_class_vptr_get (dest),
44     + gfc_class_vptr_get (se.expr));
45     + }
46     else
47     gfc_add_modify (&block, tmp,
48     fold_convert (TREE_TYPE (tmp), se.expr));