Commit 4d2d5565 authored by Jan Hubicka's avatar Jan Hubicka
Browse files

Fix wrong code with pure functions

I introduced bug into find_func_aliases_for_call in handling pure functions.
Instead of reading global memory pure functions are believed to write global
memory.  This results in misoptimization of the testcase at -O1.

The change to pta-callused.c updates the template for new behaviour of the
constraint generation. We copy nonlocal memory to calluse which is correct but
also not strictly necessary because later we take care to add nonlocal_p flag
manually.

gcc/ChangeLog:

	PR tree-optimization/103209
	* tree-ssa-structalias.c (find_func_aliases_for_call): Fix
	use of handle_rhs_call

gcc/testsuite/ChangeLog:

	PR tree-optimization/103209
	* gcc.dg/tree-ssa/pta-callused.c: Update template.
	* gcc.c-torture/execute/pr103209.c: New test.
parent 264f0619
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment