Skip to content
Snippets Groups Projects
Commit 1b1a33f7 authored by Alexandre Oliva's avatar Alexandre Oliva Committed by Alexandre Oliva
Browse files

expand: drop stack adjustments after barrier [PR118006]

A gimple block with __builtin_unreachable () can't have code after it,
and gimple optimizers ensure there isn't any, even without
optimization.  But if the block requires stack adjustments,
e.g. because of a call that passes arguments on the stack, expand will
emit that after the barrier, and then rtl checkers rightfully
complain.  Arrange to discard adjustments after a barrier.

Strub expanders seem to be necessary to bring about the exact
conditions that require stack adjustments after the block that ends
with a __builtin_unreachable call.


for  gcc/ChangeLog

	PR middle-end/118006
	* cfgexpand.cc (expand_gimple_basic_block): Do not emit
	pending stack adjustments after a barrier.

for  gcc/testsuite/ChangeLog

	PR middle-end/118006
	* gcc.target/i386/strub-pr118006.c: New.
parent 6069f02a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment