[PATCH] Fix PR77514

Richard Biener rguenther@suse.de
Fri Sep 16 08:23:00 GMT 2016


On Fri, 16 Sep 2016, Bernhard Reutner-Fischer wrote:

> On 15 September 2016 09:08:36 CEST, Richard Biener <rguenther@suse.de> wrote:
> >
> >Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
> >
> 
> >+  /* Likewise if we simplified to sth not queued for insertion.  */
> >+  bool found = false;
> >+  gsi = gsi_start (forced_stmts);
> >+  for (; !gsi_end_p (gsi); gsi_next (&gsi))
> >+    {
> >+      gimple *stmt = gsi_stmt (gsi);
> >+      tree forcedname = gimple_get_lhs (stmt);
> >+      if (forcedname == folded)
> {
> >+	found = true;
> 
> break;}
> 
> Or do we fix up such code anyway somewhere?

We don't -- I guess it would be an interesting transform but difficult
in this case as gimple_get_lhs might have side-effects we cannot skip.

It might fit loop splitting which would split it "dynamically" into
a head running until we set found to true, skipping to the tail
that has the loop with omitted guard and found = true setting.
If the loop ends up with no side-effects it should end up being
removed.  If not it might actually not be a desirable transform due
to code-size.

I'll fixup the PRE code.

Richard.



More information about the Gcc-patches mailing list