Skip to content

Fix corrupted GIMPLE for const-compound-assignment#4520

Open
Islam-Imad wants to merge 1 commit intoRust-GCC:masterfrom
Islam-Imad:fix-const-compound-assignment
Open

Fix corrupted GIMPLE for const-compound-assignment#4520
Islam-Imad wants to merge 1 commit intoRust-GCC:masterfrom
Islam-Imad:fix-const-compound-assignment

Conversation

@Islam-Imad
Copy link
Copy Markdown
Contributor

we miss to add the assignment statement.
closes #4519

@Islam-Imad
Copy link
Copy Markdown
Contributor Author

cc @powerboat9

@powerboat9 powerboat9 requested review from P-E-P and philberty April 12, 2026 00:31
@Islam-Imad Islam-Imad force-pushed the fix-const-compound-assignment branch from 4c1a8f6 to 94b9cdc Compare April 12, 2026 07:53
@Islam-Imad
Copy link
Copy Markdown
Contributor Author

ping ?

@powerboat9
Copy link
Copy Markdown
Collaborator

Could you reword the commit message a bit, before I merge?

we miss to add the assignment statement.

Also,

fix CompoundAssign

should probably start with a capital F and end with a period.

@Islam-Imad Islam-Imad force-pushed the fix-const-compound-assignment branch from 94b9cdc to 44e0394 Compare April 19, 2026 20:05
@Islam-Imad
Copy link
Copy Markdown
Contributor Author

Could you reword the commit message a bit, before I merge?

is it good right now or we need to update it again ?

@powerboat9
Copy link
Copy Markdown
Collaborator

Pretty much, just a small typo (finall -> final)

CompoundAssignmentExpr codegen was missing the final assignment statement
when it was evaluated in a const context.

gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::visit): Emit the
	missing assignment for CompoundAssignmentExpr.

gcc/testsuite/ChangeLog:

	* rust/compile/const-compound-assignment.rs: New test.
	* rust/execute/const-compound-assignment.rs: New test.

Signed-off-by: Islam-Imad <islamimad404@gmail.com>
@Islam-Imad Islam-Imad force-pushed the fix-const-compound-assignment branch from 44e0394 to cad9d90 Compare April 20, 2026 04:18
@Islam-Imad
Copy link
Copy Markdown
Contributor Author

gentle ping :)

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.

corrupted gimple

2 participants