[lto] Fixup loops before lto write-out

2018-04-26  Richard Biener <rguenther@suse.de>
	    Tom de Vries  <tom@codesourcery.com>

	PR lto/85422
	* lto-streamer-out.c (output_function): Fixup loops if required to match
	discovery done in the reader.

	* testsuite/libgomp.oacc-c-c++-common/pr85422.c: New test.

Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r259675
This commit is contained in:
Richard Biener 2018-04-26 13:26:25 +00:00 committed by Tom de Vries
parent ca9dc64220
commit d160ae7814
4 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2018-04-26 Richard Biener <rguenther@suse.de>
Tom de Vries <tom@codesourcery.com>
PR lto/85422
* lto-streamer-out.c (output_function): Fixup loops if required to match
discovery done in the reader.
2018-04-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/85116

View File

@ -2120,6 +2120,9 @@ output_function (struct cgraph_node *node)
debug info. */
if (gimple_has_body_p (function))
{
/* Fixup loops if required to match discovery done in the reader. */
loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
streamer_write_uhwi (ob, 1);
output_struct_function_base (ob, fn);
@ -2177,6 +2180,7 @@ output_function (struct cgraph_node *node)
output_cfg (ob, fn);
loop_optimizer_finalize ();
pop_cfun ();
}
else

View File

@ -1,3 +1,9 @@
2018-04-26 Richard Biener <rguenther@suse.de>
Tom de Vries <tom@codesourcery.com>
PR lto/85422
* testsuite/libgomp.oacc-c-c++-common/pr85422.c: New test.
2018-04-26 Tom de Vries <tom@codesourcery.com>
PR target/85519

View File

@ -0,0 +1,13 @@
/* { dg-do link } */
int
main (void)
{
#pragma acc parallel
#pragma acc loop
for (int i = 1; i < 10; i++)
for (;;)
;
return 0;
}