tree-optimization/95284 - amend previous store commoning fix

Generalize check for clobbers.

2020-05-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95284
	* tree-ssa-sink.c (sink_common_stores_to_bb): Amend previous
	fix.

	* g++.dg/torture/pr95284.C: New testcase.
This commit is contained in:
Richard Biener 2020-05-25 09:17:51 +02:00
parent af62ba41a4
commit f73f8bab9f
4 changed files with 28 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95284
* tree-ssa-sink.c (sink_common_stores_to_bb): Amend previous
fix.
2020-05-25 Hongtao Liu <hongtao.liu@intel.com> 2020-05-25 Hongtao Liu <hongtao.liu@intel.com>
PR target/95125 PR target/95125

View File

@ -1,3 +1,8 @@
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95284
* g++.dg/torture/pr95284.C: New testcase.
2020-05-25 Eric Botcazou <ebotcazou@adacore.com> 2020-05-25 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/renaming16.adb: New test. * gnat.dg/renaming16.adb: New test.

View File

@ -0,0 +1,16 @@
// { dg-do compile }
// { dg-require-effective-target lp64 }
#include <algorithm>
short a;
unsigned long long c;
char d;
unsigned e;
void f()
{
for (;;)
for (char b = 0; b < 19; b += 2)
a = std::min((1 ? d : 0) ? e : c, (unsigned long long)72252803048);
}

View File

@ -536,7 +536,7 @@ sink_common_stores_to_bb (basic_block bb)
else if (! operand_equal_p (gimple_assign_lhs (first_store), else if (! operand_equal_p (gimple_assign_lhs (first_store),
gimple_assign_lhs (def), 0) gimple_assign_lhs (def), 0)
|| (gimple_clobber_p (first_store) || (gimple_clobber_p (first_store)
&& !gimple_clobber_p (def))) != gimple_clobber_p (def)))
{ {
first_store = NULL; first_store = NULL;
break; break;