Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cp/class] ICE on invalid reference type in union #25

Open
xiangzhai opened this issue Feb 1, 2018 · 0 comments
Open

[cp/class] ICE on invalid reference type in union #25

xiangzhai opened this issue Feb 1, 2018 · 0 comments

Comments

@xiangzhai
Copy link

xiangzhai commented Feb 1, 2018

Hi fellows,

As PR78890 mentioned:
Testcase:

int main() {
  union {
    int a;
    int &b = a;
  };
  a = 1;
  auto c = b + 1;
}

Segfault for GCC 6-branch is reproducible:

$ /opt/loongson-gnu-6/bin/mips64-linux-gnu-g++ -c t.ii
t.ii: In function ‘int main()’:
t.ii:7:12: internal compiler error: Segmentation fault
   auto c = b + 1;
            ^
0xa7f02f crash_signal
        ../../gcc/toplev.c:333
0x811b30 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
        ../../gcc/expr.c:9971
0x821167 expand_expr
        ../../gcc/expr.h:260
0x821167 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier)
        ../../gcc/expr.c:8185
0x8124b7 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
        ../../gcc/expr.c:10925
0x81b87f expand_expr
        ../../gcc/expr.h:260
0x81b87f store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, tree_node*)
        ../../gcc/expr.c:5314
0x81c3ff expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc/expr.c:5176
0x73c0ee expand_gimple_stmt_1
        ../../gcc/cfgexpand.c:3618
0x73c0ee expand_gimple_stmt
        ../../gcc/cfgexpand.c:3714
0x73dcd5 expand_gimple_basic_block
        ../../gcc/cfgexpand.c:5720
0x7429b6 execute
        ../../gcc/cfgexpand.c:6335
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://github.com/loongson-community/gcc/issues> for instructions.

Not effect gcc 5.5, 7-branch or 8.x master.
Regards,
Leslie Zhai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant