Skip to content
Snippets Groups Projects
Commit 618bac5b authored by Martin Liska's avatar Martin Liska
Browse files

if-to-switch: properly allow side effects only for first condition

Properly allow side effects only for a first BB in a condition chain.

	PR tree-optimization/106126

gcc/ChangeLog:

	* gimple-if-to-switch.cc (struct condition_info): Save
	has_side_effect.
	(find_conditions): Parse all BBs.
	(pass_if_to_switch::execute): Allow only side effects for first
	BB.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/pr106126.c: New test.
parent 33981253
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