Skip to content

Commit

Permalink
Improve handling of empty structure constructors
Browse files Browse the repository at this point in the history
The compiler has a backend ICE. The problem
is in the front end. Dinit info dump from the
front end indicates the SPTR info for structure
constructor members are missing:
  Dinit Constant List:
0x1ff2c30(TYPEINIT):  subc:0x1ff2b30  sptr:644(parameter_list)  rc:3  next:(nil)
  0x1ff2b30(SCONST):  subc:0x1ff2bb0  sptr:645(params)  next:(nil)
    0x1ff2bb0(AST):  ast:16  dtype:6  next:0x1ff2bf0
    0x1ff2bf0(AST):  ast:2  dtype:6  next:(nil)

Which should be:

  Dinit Constant List:
0x29d5c30(TYPEINIT):  subc:0x29d5b30  sptr:644(parameter_list)  rc:3  next:(nil)
0x29d5b30 (SCONST): subc: 0x29d5bb0 sptr: 645 (params) next: (nil) 0x29d5bb0 (AST): ast: 16 dtype: 6 sptr: 636 (x) next:0x29d5bf0
    0x29d5bf0(AST):  ast:2  dtype:6  sptr:640(first$p)  next:(nil)

This SPTR information is lost during "rewrite_acl" in
"construct_acl_for_sst".  Reserve the SPTR information
in "rewrite_acl" to solve this problem.
  • Loading branch information
gklimowicz committed Nov 11, 2018
1 parent 7ed2f4e commit 8dc5b8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/flang1/flang1exe/semutil2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4554,8 +4554,10 @@ rewrite_acl(ACL *aclp, DTYPE dtype, int parent_acltype)
case AC_AST:
wrk_aclp = construct_acl_from_ast(cur_aclp->u1.ast, cur_aclp->dtype,
parent_acltype);
if (wrk_aclp)
if (wrk_aclp) {
wrk_aclp->repeatc = cur_aclp->repeatc;
wrk_aclp->sptr = cur_aclp->sptr;
}
break;
case AC_IEXPR:
wrk_aclp = cur_aclp;
Expand Down

0 comments on commit 8dc5b8b

Please sign in to comment.