Skip to content

Fix ICE in get_function_expr when cfg'd return type inside macro#4526

Open
Harishankar14 wants to merge 1 commit intoRust-GCC:masterfrom
Harishankar14:inside_macro
Open

Fix ICE in get_function_expr when cfg'd return type inside macro#4526
Harishankar14 wants to merge 1 commit intoRust-GCC:masterfrom
Harishankar14:inside_macro

Conversation

@Harishankar14
Copy link
Copy Markdown
Contributor

the problem is cfg-strip emits an error for unstrippable expressions but doesn't mark the parent for strip, leaving a broken subtree for later passes to ICE on.

gcc/rust/ChangeLog:

* expand/rust-cfg-strip.cc (CfgStrip::visit): mark CallExpr for strip when function expression fails stripping. (CfgStrip::visit): mark ArrayIndexExpr for strip when array or index expression fails stripping.

gcc/testsuite/ChangeLog:

* rust/compile/issue-4167.rs: New test.

Thank you for making Rust GCC better!

If your PR fixes an issue, you can add "Fixes #issue_number" into this
PR description and the git commit message. This way the issue will be
automatically closed when your PR is merged. If your change addresses
an issue but does not fully fix it please mark it as "Addresses #issue_number"
in the git commit message.

Here is a checklist to help you with your PR.

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

*Please write a comment explaining your change. This is the message
that will be part of the merge commit.

the problem is cfg-strip emits an error for unstrippable expressions but
doesn't mark the parent for strip, leaving a broken subtree for later
passes to ICE on.

gcc/rust/ChangeLog:

	* expand/rust-cfg-strip.cc (CfgStrip::visit): mark CallExpr for
	strip when function expression fails stripping.
	(CfgStrip::visit): mark ArrayIndexExpr for strip when array or
	index expression fails stripping.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-4167.rs: New test.

Signed-off-by: Harishankar <harishankarpp7@gmail.com>
@Harishankar14
Copy link
Copy Markdown
Contributor Author

@powerboat9 , @P-E-P

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant