[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-11-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Thu Nov 23 08:30:41 2017
New Revision: 255092

URL: https://gcc.gnu.org/viewcvs?rev=255092&root=gcc&view=rev
Log:
2017-11-23  Richard Biener  

PR tree-optimization/81403
* tree-ssa-pre.c (get_representative_for): Add parameter specifying
a block we need a leader relative to.
(phi_translate_1): For nary processing require a leader from
get_representative_for given we run expression simplification
using match-and-simplify.  Remove previous fix.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-pre.c

[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-07-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Richard Biener  ---
Fixed.

[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-07-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

--- Comment #7 from Richard Biener  ---
Author: rguenth
Date: Tue Jul 18 07:35:40 2017
New Revision: 250297

URL: https://gcc.gnu.org/viewcvs?rev=250297&root=gcc&view=rev
Log:
2017-07-18  Richard Biener  

PR tree-optimization/80620
PR tree-optimization/81403
* tree-ssa-pre.c (phi_translate_1): Clear range and points-to
info when re-using a VN table entry.

* gcc.dg/torture/pr80620.c: New testcase.
* gcc.dg/torture/pr81403.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr80620.c
trunk/gcc/testsuite/gcc.dg/torture/pr81403.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-pre.c

[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-07-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

--- Comment #6 from Richard Biener  ---
Kind-of a duplicate of PR80620 as well.  Testing a patch.

[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-07-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

--- Comment #5 from Richard Biener  ---
So this is during partial-PRE insertion where after PRE insertion of

Found partial redundancy for expression {bit_not_expr,_13} (0020)
Inserted _33 = ~_3;
 in predecessor 5 (0014)
Created phi prephitmp_34 = PHI <_33(5), _8(6)>
 in block 7 (0020)

we value-replace 0020 by prephitmp_34 and thus during partial-PRE
phi-translation
find, when translating _14 & 10393, _8 for _14 (0020) to be translated across
the edge exposing the range.

On the other edge we get from translating _14 & 10393 all the way to
translating
var_9.5_12 = var_9 as operand which leads us to var_9.1_2 = var_9 and
ultimatively
to _8 via "simplification" of ~_3 which has a leader of _33 (fine IMHO), but
unfortunately _33 has a value number of _8.

So PRE doing any insertion of a lexically equivalent expression will
necessarily
end up with a SCCVN value-number that might have range info that is not valid
there.  Thus:

tree result = vn_nary_op_lookup_pieces (newnary->length,
newnary->opcode,
newnary->type,
&newnary->op[0],
&nary);
if (result && is_gimple_min_invariant (result))
  return get_or_alloc_expr_for_constant (result);

expr = pre_expr_pool.allocate ();
expr->kind = NARY;
expr->id = 0;
if (nary)
  {
PRE_EXPR_NARY (expr) = nary;
new_val_id = nary->value_id;
get_or_alloc_expression_id (expr);
  }

needs adjustment to push away range-info.

[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-07-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |8.0

--- Comment #4 from Richard Biener  ---
Mine :/

[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-07-12 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

--- Comment #3 from Marc Glisse  ---
/* x & C -> x if we know that x & ~C == 0.  */

Not clear where it is getting the bogus range/nonzero information from, I
thought we had fixed all the places reusing SSA_NAMEs with stale information.

[Bug tree-optimization/81403] [8 Regression] wrong code at -O3

2017-07-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81403

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-12
 CC||marxin at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org
Summary|wrong code at -O3   |[8 Regression] wrong code
   ||at -O3
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Confirmed, started with r247596.