[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-08-31 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

--- Comment #9 from Patrick Palka  ---
Author: ppalka
Date: Wed Aug 31 19:06:22 2016
New Revision: 239907

URL: https://gcc.gnu.org/viewcvs?rev=239907=gcc=rev
Log:
Fix folding of VECTOR_CST comparisons

gcc/ChangeLog:

Backport from mainline
2016-08-27  Patrick Palka  

PR tree-optimization/71077
PR tree-optimization/68542
* fold-const.c (fold_relational_const): Fix folding of
VECTOR_CST comparisons that have a scalar boolean result type.

gcc/testsuite/ChangeLog:

Backport from mainline
2016-08-27  Patrick Palka  

PR tree-optimization/71077
* gcc.target/i386/pr71077.c: New test.


Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr71077.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-08-27 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

--- Comment #8 from Patrick Palka  ---
Author: ppalka
Date: Sat Aug 27 22:00:17 2016
New Revision: 239798

URL: https://gcc.gnu.org/viewcvs?rev=239798=gcc=rev
Log:
Fix folding of VECTOR_CST comparisons

gcc/ChangeLog:

PR tree-optimization/71077
PR tree-optimization/68542
* fold-const.c (fold_relational_const): Fix folding of
VECTOR_CST comparisons that have a scalar boolean result type.
(selftest::test_vector_folding): New static function.
(selftest::fold_const_c_tests): Call it.

gcc/testsuite/ChangeLog:

PR tree-optimization/71077
* gcc.target/i386/pr71077.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/i386/pr71077.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-08-18 Thread ysrumyan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

--- Comment #7 from Yuri Rumyantsev  ---
I checked that proposed patch fixed RF for 176.gcc.

Please, go ahead and commit your patch to trunk.
Thanks.
Yuri.

2016-08-12 20:14 GMT+03:00 patrick at parcs dot ath.cx
:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077
>
> --- Comment #6 from patrick at parcs dot ath.cx ---
> On Fri, 12 Aug 2016, ysrumyan at gmail dot com wrote:
>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077
>>
>> Yuri Rumyantsev  changed:
>>
>>What|Removed |Added
>> 
>>  CC||ysrumyan at gmail dot com
>>
>> --- Comment #5 from Yuri Rumyantsev  ---
>> We found out that after r235653 with minor change of int->bool type 176.gcc
>> still RF on HSW machine in 32-bit if opt level equal 3. If we turn off VRP
>> phase by -fno-tree-vrp option benchmark is passed. Need to understand why 
>> this
>> simplification affects on it.
>
> My only guess is that the combining step still doesn't handle
> VECTOR_CSTs correctly. Could you please check if this patch fixes the
> runtime failure?
>
> diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
> index 170e456..0db7bda 100644
> --- a/gcc/tree-ssa-threadedge.c
> +++ b/gcc/tree-ssa-threadedge.c
> @@ -577,6 +577,7 @@ simplify_control_stmt_condition_1 (edge e,
>if (handle_dominating_asserts
>&& (cond_code == EQ_EXPR || cond_code == NE_EXPR)
>&& TREE_CODE (op0) == SSA_NAME
> +  && INTEGRAL_TYPE_P (TREE_TYPE (op0))
>&& integer_zerop (op1))
>  {
>gimple *def_stmt = SSA_NAME_DEF_STMT (op0);
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-08-12 Thread patrick at parcs dot ath.cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

--- Comment #6 from patrick at parcs dot ath.cx ---
On Fri, 12 Aug 2016, ysrumyan at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077
> 
> Yuri Rumyantsev  changed:
> 
>What|Removed |Added
> 
>  CC||ysrumyan at gmail dot com
> 
> --- Comment #5 from Yuri Rumyantsev  ---
> We found out that after r235653 with minor change of int->bool type 176.gcc
> still RF on HSW machine in 32-bit if opt level equal 3. If we turn off VRP
> phase by -fno-tree-vrp option benchmark is passed. Need to understand why this
> simplification affects on it.

My only guess is that the combining step still doesn't handle
VECTOR_CSTs correctly. Could you please check if this patch fixes the
runtime failure?

diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 170e456..0db7bda 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -577,6 +577,7 @@ simplify_control_stmt_condition_1 (edge e,
   if (handle_dominating_asserts
   && (cond_code == EQ_EXPR || cond_code == NE_EXPR)
   && TREE_CODE (op0) == SSA_NAME
+  && INTEGRAL_TYPE_P (TREE_TYPE (op0))
   && integer_zerop (op1))
 {
   gimple *def_stmt = SSA_NAME_DEF_STMT (op0);

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-08-12 Thread ysrumyan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

Yuri Rumyantsev  changed:

   What|Removed |Added

 CC||ysrumyan at gmail dot com

--- Comment #5 from Yuri Rumyantsev  ---
We found out that after r235653 with minor change of int->bool type 176.gcc
still RF on HSW machine in 32-bit if opt level equal 3. If we turn off VRP
phase by -fno-tree-vrp option benchmark is passed. Need to understand why this
simplification affects on it.

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-05-31 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

Patrick Palka  changed:

   What|Removed |Added

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

--- Comment #4 from Patrick Palka  ---
Should be fixed.

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-05-31 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

--- Comment #3 from Patrick Palka  ---
Author: ppalka
Date: Wed Jun  1 02:36:27 2016
New Revision: 236973

URL: https://gcc.gnu.org/viewcvs?rev=236973=gcc=rev
Log:
Fix PR tree-optimization/71077

gcc/ChangeLog:

PR tree-optimization/71077
* tree-ssa-threadedge.c (simplify_control_stmt_condition_1): In
the combining step, use boolean_false_node and boolean_true_node
as the designated false/true return values.

gcc/testsuite/ChangeLog:

PR tree-optimization/71077
* gcc.dg/tree-ssa/pr71077.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr71077.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-threadedge.c

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-05-29 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

Patrick Palka  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org

[Bug tree-optimization/71077] [7 Regression] gcc -lto raises ICE

2016-05-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71077

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-05-12
 CC||ppalka at gcc dot gnu.org
   Target Milestone|--- |7.0
Summary|gcc -lto raises ICE |[7 Regression] gcc -lto
   ||raises ICE
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Confirmed.

#1  0x00d9c921 in find_taken_edge_cond_expr (
bb=, val=)
at /space/rguenther/src/svn/trunk/gcc/tree-cfg.c:2230
2230  gcc_assert (TREE_CODE (val) == INTEGER_CST);
(gdb) l
2225{
2226  edge true_edge, false_edge;
2227
2228  extract_true_false_edges_from_block (bb, _edge, _edge);
2229
2230  gcc_assert (TREE_CODE (val) == INTEGER_CST);
2231  return (integer_zerop (val) ? false_edge : true_edge);
2232}
2233
2234/* Given an INTEGER_CST VAL and the entry block BB to a SWITCH_EXPR
(gdb) p val
$1 = 

simplify_control_stmt_condition doesn't handle vector equality tests in
GIMPLE_CONDs nor do I think it handles the combining step correctly
(failing to properly use constant_boolean_node instead of zero/one).