[Bug tree-optimization/77450] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 08:06:29 2017
New Revision: 244853

URL: https://gcc.gnu.org/viewcvs?rev=244853&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-10-06  Richard Biener  

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* c-c++-common/vector-subscript-7.c: Adjust.
* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-11-02  Richard Biener  

PR tree-optimization/78047
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Initialize
fake field at offset zero conservatively regarding to
may_have_pointers.

2016-11-02  Richard Biener  

PR middle-end/78185
* loop-invariant.c (find_invariant_insn): Never hoist trapping or
faulting instructions.
* tree-ssa-loop-im.c: Include tree-ssa-loop-niter.h.
(fill_always_executed_in_1): Honor infinite child loops.

* gcc.dg/pr78185.c: New testcase.

2016-11-16  Richard Biener  

PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.

* gcc.dg/pr78333.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78185.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78333.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77855.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/c-family/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/loop-invariant.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-chrec.c
branches/gcc-5-branch/gcc/tree-data-ref.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssa-pre.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77855] [5 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77855

--- Comment #7 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 08:06:29 2017
New Revision: 244853

URL: https://gcc.gnu.org/viewcvs?rev=244853&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-10-06  Richard Biener  

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* c-c++-common/vector-subscript-7.c: Adjust.
* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-11-02  Richard Biener  

PR tree-optimization/78047
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Initialize
fake field at offset zero conservatively regarding to
may_have_pointers.

2016-11-02  Richard Biener  

PR middle-end/78185
* loop-invariant.c (find_invariant_insn): Never hoist trapping or
faulting instructions.
* tree-ssa-loop-im.c: Include tree-ssa-loop-niter.h.
(fill_always_executed_in_1): Honor infinite child loops.

* gcc.dg/pr78185.c: New testcase.

2016-11-16  Richard Biener  

PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.

* gcc.dg/pr78333.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78185.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78333.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77855.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/c-family/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/loop-invariant.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-chrec.c
branches/gcc-5-branch/gcc/tree-data-ref.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssa-pre.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77605] [5 Regression] wrong code at -O3 on x86_64-linux-gnu

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77605

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 08:06:29 2017
New Revision: 244853

URL: https://gcc.gnu.org/viewcvs?rev=244853&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-10-06  Richard Biener  

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* c-c++-common/vector-subscript-7.c: Adjust.
* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-11-02  Richard Biener  

PR tree-optimization/78047
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Initialize
fake field at offset zero conservatively regarding to
may_have_pointers.

2016-11-02  Richard Biener  

PR middle-end/78185
* loop-invariant.c (find_invariant_insn): Never hoist trapping or
faulting instructions.
* tree-ssa-loop-im.c: Include tree-ssa-loop-niter.h.
(fill_always_executed_in_1): Honor infinite child loops.

* gcc.dg/pr78185.c: New testcase.

2016-11-16  Richard Biener  

PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.

* gcc.dg/pr78333.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78185.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78333.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77855.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/c-family/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/loop-invariant.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-chrec.c
branches/gcc-5-branch/gcc/tree-data-ref.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssa-pre.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/78185] [5 Regression] Wrong branch optimization with -O1 on x86/x86_64

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78185

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 08:06:29 2017
New Revision: 244853

URL: https://gcc.gnu.org/viewcvs?rev=244853&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-10-06  Richard Biener  

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* c-c++-common/vector-subscript-7.c: Adjust.
* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-11-02  Richard Biener  

PR tree-optimization/78047
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Initialize
fake field at offset zero conservatively regarding to
may_have_pointers.

2016-11-02  Richard Biener  

PR middle-end/78185
* loop-invariant.c (find_invariant_insn): Never hoist trapping or
faulting instructions.
* tree-ssa-loop-im.c: Include tree-ssa-loop-niter.h.
(fill_always_executed_in_1): Honor infinite child loops.

* gcc.dg/pr78185.c: New testcase.

2016-11-16  Richard Biener  

PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.

* gcc.dg/pr78333.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78185.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78333.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77855.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/c-family/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/loop-invariant.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-chrec.c
branches/gcc-5-branch/gcc/tree-data-ref.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssa-pre.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug middle-end/77436] [5 Regression] Incorrect constant result for summing loop inserted

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77436

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug middle-end/77436] [5 Regression] Incorrect constant result for summing loop inserted

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77436

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 08:06:29 2017
New Revision: 244853

URL: https://gcc.gnu.org/viewcvs?rev=244853&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-10-06  Richard Biener  

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* c-c++-common/vector-subscript-7.c: Adjust.
* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-11-02  Richard Biener  

PR tree-optimization/78047
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Initialize
fake field at offset zero conservatively regarding to
may_have_pointers.

2016-11-02  Richard Biener  

PR middle-end/78185
* loop-invariant.c (find_invariant_insn): Never hoist trapping or
faulting instructions.
* tree-ssa-loop-im.c: Include tree-ssa-loop-niter.h.
(fill_always_executed_in_1): Honor infinite child loops.

* gcc.dg/pr78185.c: New testcase.

2016-11-16  Richard Biener  

PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.

* gcc.dg/pr78333.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78185.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78333.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77855.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/c-family/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/loop-invariant.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-chrec.c
branches/gcc-5-branch/gcc/tree-data-ref.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssa-pre.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77450] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED
  Known to fail|5.4.1   |5.4.0

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

[Bug middle-end/78047] [5 Regression] Chromium apparently gets miscompiled

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78047

--- Comment #15 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 08:06:29 2017
New Revision: 244853

URL: https://gcc.gnu.org/viewcvs?rev=244853&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-10-06  Richard Biener  

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* c-c++-common/vector-subscript-7.c: Adjust.
* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-11-02  Richard Biener  

PR tree-optimization/78047
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Initialize
fake field at offset zero conservatively regarding to
may_have_pointers.

2016-11-02  Richard Biener  

PR middle-end/78185
* loop-invariant.c (find_invariant_insn): Never hoist trapping or
faulting instructions.
* tree-ssa-loop-im.c: Include tree-ssa-loop-niter.h.
(fill_always_executed_in_1): Honor infinite child loops.

* gcc.dg/pr78185.c: New testcase.

2016-11-16  Richard Biener  

PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.

* gcc.dg/pr78333.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78185.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78333.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77855.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/c-family/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/loop-invariant.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-chrec.c
branches/gcc-5-branch/gcc/tree-data-ref.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssa-pre.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77605] [5 Regression] wrong code at -O3 on x86_64-linux-gnu

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77605

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED

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

[Bug middle-end/78333] [5 Regression] always-inline gnu-inline functions break -finstrument-functions

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78333

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 08:06:29 2017
New Revision: 244853

URL: https://gcc.gnu.org/viewcvs?rev=244853&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-10-06  Richard Biener  

PR tree-optimization/77855
* tree-ssa-pre.c (prune_clobbered_mems): Queue exprs to remove
instead of removing the current item while iterating over the set
which is not safe.

* gcc.dg/torture/pr77855.c: New testcase.

2016-09-01  Richard Biener  

PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.

* gcc.dg/torture/pr77436.c: New testcase.

2016-09-06  Richard Biener  

PR c/77450
c-family/
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

* c-c++-common/vector-subscript-7.c: Adjust.
* gcc.dg/pr77450.c: New testcase.

2016-09-19  Richard Biener  

PR middle-end/77605
* tree-data-ref.c (analyze_subscript_affine_affine): Use the
proper niter to bound the loops.

* gcc.dg/torture/pr77605.c: New testcase.

2016-11-02  Richard Biener  

PR tree-optimization/78047
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Initialize
fake field at offset zero conservatively regarding to
may_have_pointers.

2016-11-02  Richard Biener  

PR middle-end/78185
* loop-invariant.c (find_invariant_insn): Never hoist trapping or
faulting instructions.
* tree-ssa-loop-im.c: Include tree-ssa-loop-niter.h.
(fill_always_executed_in_1): Honor infinite child loops.

* gcc.dg/pr78185.c: New testcase.

2016-11-16  Richard Biener  

PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.

* gcc.dg/pr78333.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr77450.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78185.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr78333.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77436.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77605.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77855.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/c-family/ChangeLog
branches/gcc-5-branch/gcc/gimplify.c
branches/gcc-5-branch/gcc/loop-invariant.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-chrec.c
branches/gcc-5-branch/gcc/tree-data-ref.c
branches/gcc-5-branch/gcc/tree-ssa-loop-im.c
branches/gcc-5-branch/gcc/tree-ssa-pre.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/78185] [5 Regression] Wrong branch optimization with -O1 on x86/x86_64

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78185

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED

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

[Bug middle-end/78047] [5 Regression] Chromium apparently gets miscompiled

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78047

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug middle-end/78333] [5 Regression] always-inline gnu-inline functions break -finstrument-functions

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78333

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED
  Known to fail||5.4.0

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

[Bug fortran/79165] 100% compile-time increase for polyhedron aermod by r244581

2017-01-24 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79165

--- Comment #14 from rguenther at suse dot de  ---
On Mon, 23 Jan 2017, dmalcolm at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79165
> 
> David Malcolm  changed:
> 
>What|Removed |Added
> 
>  Status|ASSIGNED|NEW
>Assignee|dmalcolm at gcc dot gnu.org|unassigned at gcc dot 
> gnu.org
> 
> --- Comment #13 from David Malcolm  ---
> What's the purpose of the linemap_add call at line 4761?

The purpose of the call is to build a location that has LOCATION_FILE
== main_input_filename to carry main_input_filename in the built
TRANSLATION_UNIT_DECL.

[Bug c++/79205] ICE in create_tmp_var, at gimple-expr.c:473

2017-01-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79205

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-01-24
 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
   Target Milestone|--- |7.0
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed, started with r242377.

[Bug fortran/79165] 100% compile-time increase for polyhedron aermod by r244581

2017-01-24 Thread m.ostapenko at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79165

Maxim Ostapenko  changed:

   What|Removed |Added

 CC||m.ostapenko at samsung dot com

--- Comment #15 from Maxim Ostapenko  ---
(In reply to David Malcolm from comment #13)
> What's the purpose of the linemap_add call at line 4761?

I used this to add a source location for TRANSLATION_UNIT_DECL as was discussed
in pr79061. Dunno, maybe, I've reverted my patch for pr79061 so this change
isn't present anymore. As Richard pointed out in related mail it would be
better to do something like this:

+tree tu = build_decl (UNKNOWN_LOCATION, TRANSLATION_UNIT_DECL,
-   name, NULL_TREE);
+   get_identifier (main_input_filename),
+   NULL_TREE);

and use DECL_NAME (translation_unit_decl) later instead of creating new source
location.

[Bug bootstrap/79132] False positive for -Walloc-size-larger-than= with -fsanitize=address aka. bootstrap-asan breakage

2017-01-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79132

--- Comment #2 from Martin Liška  ---
Author: marxin
Date: Tue Jan 24 08:48:36 2017
New Revision: 244857

URL: https://gcc.gnu.org/viewcvs?rev=244857&root=gcc&view=rev
Log:
Fix false positive for -Walloc-size-larger-than (PR bootstrap/79132).

2017-01-24  Martin Liska  

PR bootstrap/79132
* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Insert assert
that would prevent us to call alloca with -1 as argument.

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

[Bug bootstrap/79132] False positive for -Walloc-size-larger-than= with -fsanitize=address aka. bootstrap-asan breakage

2017-01-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79132

Martin Liška  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Martin Liška  ---
Fixed.

[Bug tree-optimization/79207] New: Special trigonometric simplification for solving cubics with -ffast-math

2017-01-24 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79207

Bug ID: 79207
   Summary: Special trigonometric simplification for solving
cubics with -ffast-math
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

There is a special trigonometric identity that comes up
when solving cubic equations with three real roots
(see https://en.wikipedia.org/wiki/Cubic_function#Three_real_roots ).

The function

#include 
#define ONETHIRD (1./3.)
void c3(double alpha, double ret[3])
{
  ret[0]=cos(alpha*ONETHIRD);
  ret[1]=cos((alpha+2*M_PI)*ONETHIRD);
  ret[2]=cos((alpha-2*M_PI)*ONETHIRD);
}

could be transformed to

#include 
#define ONETHIRD (1./3.)
void c3(double alpha, double ret[3])
{
  double t_a, t_cos, t_sin, t_ss3;
  t_a = alpha * ONETHIRD;
  __builtin_sincos(t_a, &t_sin, &t_cos);
  ret[0] = t_cos;
  t_ss3 = t_sin * sqrt(3.);
  ret[1] = -0.5 * (t_ss3 + t_cos);
  ret[2] = 0.5 * (t_ss3 - t_cos);
}

replacing three calls to cos with one call to __builtin_sincos.

Of course, it could also be argued that this is an extremely
specialized case. Still, I suspect that people who calculate
solutions to cubic equations a lot (which, for example, happens
in real gas equations of state), or who calculate eigenvalues
and eigenvectors of 3*3 tensors, might be pleasantly surprised if
their codes suddenly start running much faster.

[Bug tree-optimization/56049] [7 Regression] Simplification to constants not done

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56049

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Target Milestone|7.0 |8.0

--- Comment #20 from Richard Biener  ---
Agreed.  I've briefly looked into LIM and it's not easy to teach it this.  LIM
uses its own "value numbering" and dependence analysis (ugh, well - it's
supposed
to be "cheaper" ...).  The VN used for store-motion (store and load memory
location have to be detected as equal) is using operand_equal/hash_tree which
is too simplistic here.

There is the general issue of LIM dependence analysis that it doesn't handle
dependence distance <= 0 for read-write and > 0 for write-read dependences
more optimistically.

[Bug bootstrap/79198] [7 Regression] r244802 causes out of memory during PGO bootstrap

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79198

--- Comment #8 from Richard Biener  ---
Does ggc_free handle destructors nicely?  ISTR ggc got support for
destructors...

[Bug c/79199] [7 Regression] ICE with -Wduplicated-branches

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79199

Richard Biener  changed:

   What|Removed |Added

   Keywords||diagnostic,
   ||ice-on-valid-code
   Priority|P3  |P1
   Target Milestone|--- |7.0
Summary|ICE with|[7 Regression] ICE with
   |-Wduplicated-branches   |-Wduplicated-branches

[Bug tree-optimization/79201] missed optimization: gcc fails to cut out unnecessary loop.

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79201

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-01-24
  Component|c   |tree-optimization
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.  code sinking doesn't sink calls.  While that's easily fixed for
this case PRE running before sinking produces

   [3.03%]:

   [96.97%]:
  # i_10 = PHI 
  # prephitmp_2 = PHI <_3(4), 0(2)>
  i_6 = i_10 + 1;
  if (i_6 != 32)
goto ; [96.88%]
  else
goto ; [3.12%]

   [93.94%]:
  _3 = __builtin_ffs (i_6);
  goto ; [100.00%]

   [3.03%]:
  return prephitmp_2;

which makes this no longer a sinking opportunity code sinking handles (it can't
"sink" PHIs).  But we shouldn't insert loop uses for stuff w/o loop uses.  Oh,
and final value replacement also doesn't understand the above either.

Will fix for GCC 8.

Index: gcc/tree-ssa-sink.c
===
--- gcc/tree-ssa-sink.c (revision 244856)
+++ gcc/tree-ssa-sink.c (working copy)
@@ -254,8 +254,10 @@ statement_sink_location (gimple *stmt, b
   ssa_op_iter iter;
   imm_use_iterator imm_iter;

-  /* We only can sink assignments.  */
-  if (!is_gimple_assign (stmt))
+  /* We only can sink assignments or const/pure calls.  */
+  if (!is_gimple_assign (stmt)
+  && (!is_gimple_call (stmt)
+ || ! (gimple_call_flags (stmt) & (ECF_CONST|ECF_PURE
 return false;

   /* We only can sink stmts with a single definition.  */

Generally one can say the PRE data-flow gets confused by "wrongly placed"
computations (aka trivial sinking opportunities).  So it might make sense
to swap PRE and sink passes (PRE shouldn't expose sinking opportunities
but through the VN it performs).

[Bug c++/79205] ICE in create_tmp_var, at gimple-expr.c:473

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79205

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Reduced testcase:
template  struct B;
template  struct B { int b; };
template  struct C { B<0, E...> c; C (C &) = default; C (C &&);
};
template  struct tuple_size;
template <> struct tuple_size> { static constexpr int value = 1; };
template  struct tuple_element;
template 
struct tuple_element<0, C> { typedef int type; };
template 
int &&get (C &&);

void
foo (C t)
{
  auto[x0] = t;
}

[Bug c++/79205] ICE in create_tmp_var, at gimple-expr.c:473

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79205

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

Breakpoint 1, fancy_abort (
file=0x1e2fb90 "/space/rguenther/src/svn/gcc-7-branch/gcc/gimple-expr.c", 
line=473, 
function=0x1e2fd73 
"create_tmp_var") at
/space/rguenther/src/svn/gcc-7-branch/gcc/diagnostic.c:1461
1461  internal_error ("in %s, at %s:%d", function, trim_filename (file),
line);
Missing separate debuginfos, use: zypper install
libgmp10-debuginfo-5.1.3-5.46.x86_64 libisl15-debuginfo-0.16.1-30.30.x86_64
libmpc3-debuginfo-1.0.2-4.55.x86_64 libmpfr4-debuginfo-3.1.2-11.53.x86_64
(gdb) up
#1  0x00ddb5da in create_tmp_var (type=
, prefix=0x0)
at /space/rguenther/src/svn/gcc-7-branch/gcc/gimple-expr.c:473
473   gcc_assert (!TREE_ADDRESSABLE (type) && COMPLETE_TYPE_P (type));
(gdb) p debug_tree (type)
  constant 32>

gimplifying **t in

;; Function int foo(std::tuple) (null)
;; enabled by -tree-original

{
  struct tuple D.33733 = **t;
  type & x0;

struct tuple D.33733 = **t;
type & x0;
  < ((struct tuple &) &D.33733)) >;
  return  = *x0;
}


gcc 6 rejects this with

t.C: In function ‘int foo(std::tuple)’:
t.C:5:8: error: expected unqualified-id before ‘[’ token
   auto [x0] = t;
^
t.C:6:12: error: ‘x0’ was not declared in this scope
 return x0;
^~

[Bug tree-optimization/79207] Special trigonometric simplification for solving cubics with -ffast-math

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79207

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-01-24
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Basically fits the "dataflow" we do in the sincos pass, you'd have to pattern
match the add/mul sequence and relate the args to the cos calls of course.

Just in case anybody wants to work on this...

[Bug libstdc++/79206] string_view operator== could do an early exit if sizes differ

2017-01-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79206

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-01-24
 Ever confirmed|0   |1

[Bug fortran/79165] 100% compile-time increase for polyhedron aermod by r244581

2017-01-24 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79165

--- Comment #16 from rguenther at suse dot de  ---
On Tue, 24 Jan 2017, m.ostapenko at samsung dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79165
> 
> Maxim Ostapenko  changed:
> 
>What|Removed |Added
> 
>  CC||m.ostapenko at samsung dot 
> com
> 
> --- Comment #15 from Maxim Ostapenko  ---
> (In reply to David Malcolm from comment #13)
> > What's the purpose of the linemap_add call at line 4761?
> 
> I used this to add a source location for TRANSLATION_UNIT_DECL as was 
> discussed
> in pr79061. Dunno, maybe, I've reverted my patch for pr79061 so this change
> isn't present anymore. As Richard pointed out in related mail it would be
> better to do something like this:
> 
> +tree tu = build_decl (UNKNOWN_LOCATION, TRANSLATION_UNIT_DECL,
> -   name, NULL_TREE);
> +   get_identifier (main_input_filename),
> +   NULL_TREE);
> 
> and use DECL_NAME (translation_unit_decl) later instead of creating new source
> location.

Well, rather pass down get_identifier (main_input_fileame) in the callers.

Richard.

[Bug sanitizer/79200] Race-Condition in Address Santitizer

2017-01-24 Thread tommapson at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79200

--- Comment #2 from tommapson at gmx dot de ---
Thanks, so the problem seems to depend on the linux kernel.

Linux wendy3 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64
GNU/Linux

doesn't have the problem, while

Linux heppo1 4.6.7-rt14 #3 SMP PREEMPT RT Fri Oct 28 09:45:23 CEST 2016 x86_64
GNU/Linux

has it. I'll attach the kernel config.

[Bug sanitizer/79200] Race-Condition in Address Santitizer

2017-01-24 Thread tommapson at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79200

--- Comment #3 from tommapson at gmx dot de ---
Created attachment 40569
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40569&action=edit
Kernel-Config for realtime-kernel showing the bug

Used Kernel-Sources: 4.6.7
applied RT_PREEMPT-Patch 4.6.7-rt14

[Bug c++/79205] ICE in create_tmp_var, at gimple-expr.c:473

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79205

--- Comment #4 from Jakub Jelinek  ---
So the bug is obviously **t, i.e. double indirection when only one should be
used.
The problem is that the D.2164 artificial variable (the "e" variable from
[dcl.decomp]) appears both in its own DECL_EXPR and among block vars, and has
DECL_INITIAL initially PARM_DECL t, which is an invisiref parameter that
genericization wants to turn into a reference.
First we walk it during tree walk of the DECL_EXPR and change the DECL_INITIAL
into INDIRECT_REF  (correct).  And then we walk it again and
replace it again with INDIRECT_REF > (wrong).

[Bug middle-end/56727] Recursive call goes through the PLT unnecessarily

2017-01-24 Thread tetra2005 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727

--- Comment #9 from Yuri Gribov  ---
(In reply to Alexander Monakov from comment #8)
> Well, if my argument is correct, then GCC generates wrong code for the very
> first example in comment #0.

I believe it does (see my #5, most probly author of some pass failed to check
for interposition).  Note that simple recursive factorial is expanded to loop
too which is a more impressive instance of this bug.

> To my knowledge, that
> is the sole instance where optimization doesn't fully honor ELF
> interposition possibility.

+1

[Bug sanitizer/79200] Race-Condition in Address Santitizer

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79200

--- Comment #4 from Jakub Jelinek  ---
Then you likely want to report it to kernel bugzilla or whomever provided the
RT_PREEMPT patch (if it can't be reproduced without that), not here.

[Bug middle-end/79123] incorrect -Walloca-larger-than: alloca may be too large due to conversion from long int to long unsigned int

2017-01-24 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79123

Aldy Hernandez  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Aldy Hernandez  ---
Fixed in trunk.

[Bug middle-end/79123] incorrect -Walloca-larger-than: alloca may be too large due to conversion from long int to long unsigned int

2017-01-24 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79123

--- Comment #3 from Aldy Hernandez  ---
Author: aldyh
Date: Tue Jan 24 09:50:33 2017
New Revision: 244859

URL: https://gcc.gnu.org/viewcvs?rev=244859&root=gcc&view=rev
Log:
PR middle-end/79123
* gimple-ssa-warn-alloca.c (alloca_call_type): Make sure
casts from signed to unsigned really don't have a range.

Added:
trunk/gcc/testsuite/gcc.dg/Walloca-13.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-warn-alloca.c

[Bug translation/79208] New: Typo in gcc/ipa-devirt.c:1631

2017-01-24 Thread fmarchal at perso dot be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79208

Bug ID: 79208
   Summary: Typo in gcc/ipa-devirt.c:1631
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: translation
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fmarchal at perso dot be
  Target Milestone: ---

I believe there is a typo in the warning message reported in ipa-devirt.c at
line 1631:

if (DECL_VIRTUAL_P (f1) != DECL_VIRTUAL_P (f2))
{
warn_odr (t1, t2, f1, f2, warn, warned,
 G_("s definition that differs by virtual "
 "keyword in another translation unit"));
return false;
}

The first lone "s" may be a "a". Or the whole word ("same" maybe) is truncated.

The Swedish translator opted for a "a".

[Bug c++/79205] ICE in create_tmp_var, at gimple-expr.c:473

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79205

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #5 from Jakub Jelinek  ---
Created attachment 40570
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40570&action=edit
gcc7-pr79205.patch

Untested fix.

[Bug target/78945] [arm] libatomic inline asm is not compatible with armv7-m

2017-01-24 Thread nsz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78945

--- Comment #3 from nsz at gcc dot gnu.org ---
(In reply to Ramana Radhakrishnan from comment #2)
> A simple patch would be to check for __ARM_FEATURE_SAT in all those macros
> in exch_n.c along with HAVE_STREXB etc .. 

__ARM_FEATURE_SIMD32 seems to be the right feature test macro,
(_SAT is defined on armv7-m) and with that libatomic compiles.

[Bug bootstrap/79198] [7 Regression] r244802 causes out of memory during PGO bootstrap

2017-01-24 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79198

--- Comment #9 from Martin Jambor  ---
Author: jamborm
Date: Tue Jan 24 10:04:21 2017
New Revision: 244860

URL: https://gcc.gnu.org/viewcvs?rev=244860&root=gcc&view=rev
Log:
[PR 79198] Call ipa-prop func summary destructor

2017-01-24  Martin Jambor  

PR bootstrap/79198
* ipa-prop.c (ipa_free_all_node_params): Call summary destructor.
* ipa-prop.c (ipa_node_params_t::insert): Initialize fields known_csts
and known_contexts.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-prop.c

[Bug c++/79209] New: AArch64: Inconsistent packed volatile bitfield accesses

2017-01-24 Thread p...@gcc-bugzilla.mail.kapsi.fi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79209

Bug ID: 79209
   Summary: AArch64: Inconsistent packed volatile bitfield
accesses
   Product: gcc
   Version: 7.0.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: p...@gcc-bugzilla.mail.kapsi.fi
  Target Milestone: ---

Created attachment 40571
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40571&action=edit
Packed volatile bitfield testcase for both C and C++.

Hi.

It seems that volatile bitfield structures with the packed attribute set (that
are not accompanied with an aligned attribute) are accessed quite
inconsistently. The instruction used to access the volatile bitfield depends on
the optimization level, the bitfield width and the the value itself.

Moreover, -fstrict-volatile-bitfields seems to have no particular effect on
this matter (e.g. only a temporary register used to access field was changed).
Yes, noticed that there was a note regarding packed fields in the manual, but
perhaps I expected it to only cover some rare special cases.

Consider the following structure and function:

struct __attribute__((packed)) S0
{
unsigned volatile int y : 1;
unsigned volatile int x : 2;
unsigned volatile int z : 29;
}

volatile struct S0 * fn();

When updating the structure GCC generally prefers ldr w/str w (word) pair,
which is to be expected. However, based on the value being written GCC may
access the structure using ldrb w/strb w (byte) pair; usually if structure
access is not inlined and and/orr instruction is chosen based on the value
being written. Of course, should the underlying hardware only support word
access byte access will of couse fail -- hence the volatile bitfield in the
first place.

With both packed and aligned attributes set everything works as expected. I
guess the packed bitfields have been somewhat difficult thing to define and
agreed on, so a warning message (and a documentation entry explaining it) would
be just fine. Certainly could be just that I'm wrong, but as this was a tad
difficult to spot I'd still prefer it any day of the week.

Tested using GCC 6.2, 6.3 and 7.0.1 (trunk) and they all produce pratically
identical results. Both C and C++ frontends share this same mishap or feature.

aarch64-none-elf-gcc -Wall -Wextra -mabi=lp64 -fstrict-volatile-bitfields
-fno-exceptions -xc++ {-O0,-Og,-O1,-O2,-O3} -S packed-volatile-bitfield.in -o -

[Bug bootstrap/79198] [7 Regression] r244802 causes out of memory during PGO bootstrap

2017-01-24 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79198

Martin Jambor  changed:

   What|Removed |Added

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

--- Comment #10 from Martin Jambor  ---
Should be fixed with:

https://gcc.gnu.org/ml/gcc-patches/2017-01/msg01848.html

[Bug target/78478] Compile Error for i386-rtems

2017-01-24 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78478

--- Comment #26 from uros at gcc dot gnu.org ---
Author: uros
Date: Tue Jan 24 10:54:56 2017
New Revision: 244862

URL: https://gcc.gnu.org/viewcvs?rev=244862&root=gcc&view=rev
Log:
PR target/78478
* config/ax_check_define.m4: New file.

libgfortran/ChangeLog:

PR target/78478
* acinclude.m4: Include ../config/ax_check_define.m4
* configure.ac: Check if _SOFT_FLOAT is defined.
* configure.host (i?86 | x86_64): Use fpu-generic when
have_soft_float is set.
* configure: Regenerate.

gcc/ChangeLog:

PR target/78478
Revert:
2013-11-05  Uros Bizjak  

* config/i386/rtemself.h (LONG_DOUBLE_TYPE_SIZE): New define.


Added:
branches/gcc-6-branch/config/ax_check_define.m4
Modified:
branches/gcc-6-branch/ChangeLog
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/i386/rtemself.h
branches/gcc-6-branch/libgfortran/ChangeLog
branches/gcc-6-branch/libgfortran/acinclude.m4
branches/gcc-6-branch/libgfortran/configure
branches/gcc-6-branch/libgfortran/configure.ac
branches/gcc-6-branch/libgfortran/configure.host

[Bug target/78478] Compile Error for i386-rtems

2017-01-24 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78478

Uroš Bizjak  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.4

--- Comment #27 from Uroš Bizjak  ---
Fixed.

[Bug translation/79208] Typo in gcc/ipa-devirt.c:1631

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79208

--- Comment #1 from Richard Biener  ---
The "s" is supposed to "merge" with a previously printed name to say
"bars definition" for the name 'bar'.  I suppose that doesn't play well
with translation - is there anything that we should use instead?
(apart from changing it to sth like "the definition of $name differs...")

[Bug preprocessor/79210] New: "internal compiler error: in get_substring_ranges_for_loc" processing -Wformat-signedness warning

2017-01-24 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79210

Bug ID: 79210
   Summary: "internal compiler error: in
get_substring_ranges_for_loc" processing
-Wformat-signedness warning
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: arnd at linaro dot org
  Target Milestone: ---

I ran into a variant of pr78569, again building the kernel, reduced test case
of 
drivers/scsi/lpfc/lpfc_attr.c:

/* build with gcc-7.0.0 -c test.c -Wformat -Wformat-signedness */
__attribute__((format(printf, 3, 4)))
void dev_printk(const char *level, void *dev, const char *fmt, ...);

#define lpfc_vport_param_init(attr) \
void lpfc_##attr##_init(void *vport, unsigned int val) \
{ \
dev_printk("3", (void *)0, \
   "0423 lpfc_"#attr" attribute cannot be set to %d, "\
   "allowed range is [0, 1]\n", val); \
}

#define LPFC_VPORT_ATTR_R(name, desc) \
unsigned int lpfc_##name;\
lpfc_vport_param_init(name)\

LPFC_VPORT_ATTR_R(peer_port_login,
  "Allow peer ports on the same physical port to login to each
"
  "other.");
// EOF

/git/arm-soc/drivers/scsi/lpfc/lpfc_attr.c: In function
'lpfc_peer_port_login_init':
/git/arm-soc/drivers/scsi/lpfc/lpfc_attr.c:16:1: internal compiler error: in
get_substring_ranges_for_loc, at input.c:1398
 LPFC_VPORT_ATTR_R(peer_port_login,
 ^
0x38c get_substring_ranges_for_loc
/home/arnd/git/gcc/gcc/input.c:1398
0x38c get_source_location_for_substring(cpp_reader*, string_concat_db*,
unsigned int, cpp_ttype, int, int, int, unsigned int*)
/home/arnd/git/gcc/gcc/input.c:1468
0x672afe c_get_substring_location(substring_loc const&, unsigned int*)
/home/arnd/git/gcc/gcc/c-family/c-common.c:865
0x69ea5e get_corrected_substring
/home/arnd/git/gcc/gcc/c-family/c-format.c:3308
0x69ea5e format_type_warning
/home/arnd/git/gcc/gcc/c-family/c-format.c:3461
0x6a01f7 check_format_types
/home/arnd/git/gcc/gcc/c-family/c-format.c:3075
0x6a01f7 argument_parser::check_argument_type(format_char_info const*,
length_modifier const&, tree_node*&, char const*&, bool, unsigned long&,
tree_node*&, int, char const*, char const*, unsigned int, char)
/home/arnd/git/gcc/gcc/c-family/c-format.c:2675
0x6a2d07 argument_parser::check_argument_type(format_char_info const*,
length_modifier const&, tree_node*&, char const*&, bool, unsigned long&,
tree_node*&, int, char const*, char const*, unsigned int, char)
/home/arnd/git/gcc/gcc/c-family/c-format.c:2568
0x6a2d07 check_format_info_main
/home/arnd/git/gcc/gcc/c-family/c-format.c:2813
0x6a2d07 check_format_arg
/home/arnd/git/gcc/gcc/c-family/c-format.c:1672
0x6a0e5e check_format_info
/home/arnd/git/gcc/gcc/c-family/c-format.c:1405
0x6a0e5e check_function_format(tree_node*, int, tree_node**)
/home/arnd/git/gcc/gcc/c-family/c-format.c:1066
0x695712 check_function_arguments(unsigned int, tree_node const*, int,
tree_node**)
/home/arnd/git/gcc/gcc/c-family/c-common.c:5599
0x638e8b build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*)
/home/arnd/git/gcc/gcc/c/c-typeck.c:3113
0x6556d7 c_parser_postfix_expression_after_primary
/home/arnd/git/gcc/gcc/c/c-parser.c:8402
0x64e4ea c_parser_postfix_expression
/home/arnd/git/gcc/gcc/c/c-parser.c:8194
0x65105a c_parser_unary_expression
/home/arnd/git/gcc/gcc/c/c-parser.c:7012
0x651daf c_parser_cast_expression
/home/arnd/git/gcc/gcc/c/c-parser.c:6841
0x651ff5 c_parser_binary_expression
/home/arnd/git/gcc/gcc/c/c-parser.c:6650
0x652c88 c_parser_conditional_expression
/home/arnd/git/gcc/gcc/c/c-parser.c:6418

[Bug target/79209] AArch64: Inconsistent packed volatile bitfield accesses

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79209

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 Target||aarch64
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-01-24
  Component|c++ |target
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
The question is whether a -fstrict-volatile-bitfield volatile bitfield isn't
ill-formed if not properly aligned.  At least for architectures with strict
alignment requirements - aarch has

/* Define this macro to be non-zero if instructions will fail to work
   if given data not on the nominal alignment.  */
#define STRICT_ALIGNMENTTARGET_STRICT_ALIGN

and -mstrict-align (not sure about the default).  Note this may be very well
a fault of the aarch64 insv/extv patterns (or we may not use those with
-fstrict-volatile-bitfields or their use need to be massaged).

-fstrict-volatile-bitfields should guarantee the access is in SImode in this
case (AFAIR).

[Bug middle-end/79209] [5/6/7 Regression] AArch64: Inconsistent packed volatile bitfield accesses

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79209

Richard Biener  changed:

   What|Removed |Added

 Target|aarch64 |aarch64, x86_64-*-*
   Priority|P3  |P2
  Component|target  |middle-end
  Known to work||4.8.5, 4.9.4
   Target Milestone|--- |5.5
Summary|AArch64: Inconsistent   |[5/6/7 Regression] AArch64:
   |packed volatile bitfield|Inconsistent packed
   |accesses|volatile bitfield accesses
  Known to fail||5.3.0

--- Comment #2 from Richard Biener  ---
Btw, also confirmed on x86_64 but it seems to work with GCC 4.8 and 4.9 there.

[Bug translation/79208] Typo in gcc/ipa-devirt.c:1631

2017-01-24 Thread fmarchal at perso dot be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79208

--- Comment #2 from Frederic Marchal  ---
If the printed message is supposed to be concatenated with something else, then
there is another problem with every other messages printed by function
odr_types_equivalent_p()! All the messages I could see are like these one:

G_("a different type is defined in another translation unit"));

G_("an enum with different value name"
   " is defined in another translation unit"));

G_("virtual table layout differs "
   "in another translation unit"));

The messages would incorrectly merge the beginning of the string with the
previously printed name without any space.

So, either the message starting with "s" doesn't do what is expected or every
other message don't do what is expected.

[Bug tree-optimization/77450] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors

2017-01-24 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450

Christophe Lyon  changed:

   What|Removed |Added

 CC||clyon at gcc dot gnu.org

--- Comment #10 from Christophe Lyon  ---
The new testcase pr77450.c fails to compile on aarch64/arm (in gcc-5-branch).

I'm seeing:
testsuite/gcc.dg/pr77450.c:10:1: internal compiler error: in verify_ssa, at
tree-ssa.c:945
0xc51485 verify_ssa(bool, bool)
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-ssa.c:945
0x994fbd execute_function_todo
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:1966
0x994b4d do_per_function
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:1658
0x996483 execute_todo
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:2016

[Bug target/77468] [7 Regression] C-ray regression on Aarch64

2017-01-24 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77468

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-01-24
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #9 from Aldy Hernandez  ---
Confirmed with:

$ wget http://www.phoronix-test-suite.com/benchmark-files/c-ray-1.1.tar.gz
$ tar -xzf c-ray-1.1.tar.gz
$ cd c-ray-1.1


$ make clean; make CC="~/bld/trunk/install/bin/gcc"
rm -f c-ray-mt.o c-ray-mt
~/bld/trunk/install/bin/gcc -O3 -ffast-math -mcpu=cortex-a53   -c -o c-ray-mt.o
c-ray-mt.c
~/bld/trunk/install/bin/gcc -o c-ray-mt c-ray-mt.o -lm -lpthread
$ ./c-ray-mt -t 32  -s 800x600 -r 8 -i sphfract -o output.ppm
c-ray-mt v1.1
Rendering took: 8 seconds (8766 milliseconds)


$ make clean; make CC=gcc-5.3.1
rm -f c-ray-mt.o c-ray-mt
gcc-5.3.1 -O3 -ffast-math -mcpu=cortex-a53   -c -o c-ray-mt.o c-ray-mt.c
gcc-5.3.1 -o c-ray-mt c-ray-mt.o -lm -lpthread
aldyh@gcc117:~/c-ray-1.1> ./c-ray-mt -t 32  -s 800x600 -r 8 -i sphfract -o
output.ppm
c-ray-mt v1.1
Rendering took: 7 seconds (7606 milliseconds)

I'll bisect this.

[Bug preprocessor/79210] "internal compiler error: in get_substring_ranges_for_loc" processing -Wformat-signedness warning

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79210

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Can't reproduce on x86_64-linux on the #c0 reduced testcase, and valgrind
doesn't show anything interesting either.

[Bug middle-end/79209] [5/6/7 Regression] AArch64: Inconsistent packed volatile bitfield accesses

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79209

--- Comment #3 from Richard Biener  ---
On x86_64 expansion is fine:

;; MEM[(volatile struct s0_t *)4B].y ={v} 1;

(insn 5 4 6 (set (reg/f:DI 89)
(const_int 4 [0x4])) "t.c":58 -1
 (nil))

(insn 6 5 8 (set (reg:SI 90)
(mem/v/j:SI (reg/f:DI 89) [0 +0 S4 A32])) "t.c":58 -1
 (nil))

(insn 8 6 9 (parallel [
(set (reg:SI 92)
(ior:SI (reg:SI 90)
(const_int 1 [0x1])))
(clobber (reg:CC 17 flags))
]) "t.c":58 -1
 (nil))

(insn 9 8 10 (set (reg:SI 90)
(reg:SI 92)) "t.c":58 -1
 (nil))

(insn 10 9 0 (set (mem/v/j:SI (reg/f:DI 89) [0 +0 S4 A32])
(reg:SI 90)) "t.c":58 -1
 (nil))


For the non-inlined case we run into

static bool
strict_volatile_bitfield_p (rtx op0, unsigned HOST_WIDE_INT bitsize,
unsigned HOST_WIDE_INT bitnum,
machine_mode fieldmode,
unsigned HOST_WIDE_INT bitregion_start,
unsigned HOST_WIDE_INT bitregion_end)
...
  /* The memory must be sufficiently aligned for a MODESIZE access.
 This condition guarantees, that the memory access will not
 touch anything after the end of the structure.  */
  if (MEM_ALIGN (op0) < modesize)
return false;

and thus get byte accesses forced.


Thus you indeed need properly aligned bitfields for correctness reasons
(in theory it could look at the bitregion to see if the access is
allowed -- wouldn't help this testcase though).

[Bug c++/71848] [7 Regression] libstdc++ testsuite error on AIX

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71848

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 11:30:44 2017
New Revision: 244864

URL: https://gcc.gnu.org/viewcvs?rev=244864&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-09-20  Richard Biener  

PR tree-optimization/77646
* tree-ssa-sccvn.c (visit_reference_op_call): Always value-number
a VDEF.

* gcc.dg/torture/pr77646.c: New testcase.

2016-11-05  David Edelsohn  
Richard Biener  

PR bootstrap/78188
PR c++/71848
* ipa-comdats.c (pass_ipa_comdats::gate): Require HAVE_COMDAT_GROUP.

* g++.dg/ipa/pr78188.C: New test.   

2016-09-21  Richard Biener  

PR tree-optimization/77648
* tree-ssa-structalias.c (process_constraint): Handle all DEREF
with complex RHS.
(make_transitive_closure_constraints): Adjust comment.
(make_any_offset_constraints): New function.
(handle_rhs_call): Make sure to first expand a pointer to all
subfields before transitively closing it.
(handle_const_call): Likewise.  Properly expand returned
pointers as well.
(handle_pure_call): Likewise.

* gcc.dg/torture/pr77648-1.c: New testcase.
* gcc.dg/torture/pr77648-2.c: Likewise.

2016-10-07  Richard Biener  

PR tree-optimization/77879
* tree-ssa-structalias.c (handle_const_call): Properly handle
NRV return slots.
(handle_pure_call): Likewise.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/ipa/pr78188.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77646.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-1.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-2.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/ipa-comdats.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-ssa-sccvn.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77648] [5 Regression] Setting conversion to a integer to double to 0 3/4 through a loop

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77648

--- Comment #12 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 11:30:44 2017
New Revision: 244864

URL: https://gcc.gnu.org/viewcvs?rev=244864&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-09-20  Richard Biener  

PR tree-optimization/77646
* tree-ssa-sccvn.c (visit_reference_op_call): Always value-number
a VDEF.

* gcc.dg/torture/pr77646.c: New testcase.

2016-11-05  David Edelsohn  
Richard Biener  

PR bootstrap/78188
PR c++/71848
* ipa-comdats.c (pass_ipa_comdats::gate): Require HAVE_COMDAT_GROUP.

* g++.dg/ipa/pr78188.C: New test.   

2016-09-21  Richard Biener  

PR tree-optimization/77648
* tree-ssa-structalias.c (process_constraint): Handle all DEREF
with complex RHS.
(make_transitive_closure_constraints): Adjust comment.
(make_any_offset_constraints): New function.
(handle_rhs_call): Make sure to first expand a pointer to all
subfields before transitively closing it.
(handle_const_call): Likewise.  Properly expand returned
pointers as well.
(handle_pure_call): Likewise.

* gcc.dg/torture/pr77648-1.c: New testcase.
* gcc.dg/torture/pr77648-2.c: Likewise.

2016-10-07  Richard Biener  

PR tree-optimization/77879
* tree-ssa-structalias.c (handle_const_call): Properly handle
NRV return slots.
(handle_pure_call): Likewise.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/ipa/pr78188.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77646.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-1.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-2.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/ipa-comdats.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-ssa-sccvn.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77646] [5 Regression] GCC Segfault with -O3

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77646

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED

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

[Bug ipa/78188] [7 Regression] AIX Bootstrap broken by tree-vrp.c change

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78188

--- Comment #28 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 11:30:44 2017
New Revision: 244864

URL: https://gcc.gnu.org/viewcvs?rev=244864&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-09-20  Richard Biener  

PR tree-optimization/77646
* tree-ssa-sccvn.c (visit_reference_op_call): Always value-number
a VDEF.

* gcc.dg/torture/pr77646.c: New testcase.

2016-11-05  David Edelsohn  
Richard Biener  

PR bootstrap/78188
PR c++/71848
* ipa-comdats.c (pass_ipa_comdats::gate): Require HAVE_COMDAT_GROUP.

* g++.dg/ipa/pr78188.C: New test.   

2016-09-21  Richard Biener  

PR tree-optimization/77648
* tree-ssa-structalias.c (process_constraint): Handle all DEREF
with complex RHS.
(make_transitive_closure_constraints): Adjust comment.
(make_any_offset_constraints): New function.
(handle_rhs_call): Make sure to first expand a pointer to all
subfields before transitively closing it.
(handle_const_call): Likewise.  Properly expand returned
pointers as well.
(handle_pure_call): Likewise.

* gcc.dg/torture/pr77648-1.c: New testcase.
* gcc.dg/torture/pr77648-2.c: Likewise.

2016-10-07  Richard Biener  

PR tree-optimization/77879
* tree-ssa-structalias.c (handle_const_call): Properly handle
NRV return slots.
(handle_pure_call): Likewise.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/ipa/pr78188.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77646.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-1.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-2.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/ipa-comdats.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-ssa-sccvn.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77648] [5 Regression] Setting conversion to a integer to double to 0 3/4 through a loop

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77648

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED

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

[Bug tree-optimization/77879] [5 Regression] mpd gets miscompiled since r235622

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77879

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED

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

[Bug tree-optimization/77646] [5 Regression] GCC Segfault with -O3

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77646

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.1
 Resolution|--- |FIXED

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

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 11:30:44 2017
New Revision: 244864

URL: https://gcc.gnu.org/viewcvs?rev=244864&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-09-20  Richard Biener  

PR tree-optimization/77646
* tree-ssa-sccvn.c (visit_reference_op_call): Always value-number
a VDEF.

* gcc.dg/torture/pr77646.c: New testcase.

2016-11-05  David Edelsohn  
Richard Biener  

PR bootstrap/78188
PR c++/71848
* ipa-comdats.c (pass_ipa_comdats::gate): Require HAVE_COMDAT_GROUP.

* g++.dg/ipa/pr78188.C: New test.   

2016-09-21  Richard Biener  

PR tree-optimization/77648
* tree-ssa-structalias.c (process_constraint): Handle all DEREF
with complex RHS.
(make_transitive_closure_constraints): Adjust comment.
(make_any_offset_constraints): New function.
(handle_rhs_call): Make sure to first expand a pointer to all
subfields before transitively closing it.
(handle_const_call): Likewise.  Properly expand returned
pointers as well.
(handle_pure_call): Likewise.

* gcc.dg/torture/pr77648-1.c: New testcase.
* gcc.dg/torture/pr77648-2.c: Likewise.

2016-10-07  Richard Biener  

PR tree-optimization/77879
* tree-ssa-structalias.c (handle_const_call): Properly handle
NRV return slots.
(handle_pure_call): Likewise.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/ipa/pr78188.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77646.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-1.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-2.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/ipa-comdats.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-ssa-sccvn.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77879] [5 Regression] mpd gets miscompiled since r235622

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77879

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 11:30:44 2017
New Revision: 244864

URL: https://gcc.gnu.org/viewcvs?rev=244864&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-09-20  Richard Biener  

PR tree-optimization/77646
* tree-ssa-sccvn.c (visit_reference_op_call): Always value-number
a VDEF.

* gcc.dg/torture/pr77646.c: New testcase.

2016-11-05  David Edelsohn  
Richard Biener  

PR bootstrap/78188
PR c++/71848
* ipa-comdats.c (pass_ipa_comdats::gate): Require HAVE_COMDAT_GROUP.

* g++.dg/ipa/pr78188.C: New test.   

2016-09-21  Richard Biener  

PR tree-optimization/77648
* tree-ssa-structalias.c (process_constraint): Handle all DEREF
with complex RHS.
(make_transitive_closure_constraints): Adjust comment.
(make_any_offset_constraints): New function.
(handle_rhs_call): Make sure to first expand a pointer to all
subfields before transitively closing it.
(handle_const_call): Likewise.  Properly expand returned
pointers as well.
(handle_pure_call): Likewise.

* gcc.dg/torture/pr77648-1.c: New testcase.
* gcc.dg/torture/pr77648-2.c: Likewise.

2016-10-07  Richard Biener  

PR tree-optimization/77879
* tree-ssa-structalias.c (handle_const_call): Properly handle
NRV return slots.
(handle_pure_call): Likewise.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/ipa/pr78188.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77646.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-1.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77648-2.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/ipa-comdats.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-ssa-sccvn.c
branches/gcc-5-branch/gcc/tree-ssa-structalias.c

[Bug target/59371] [5/6/7 Regression] Performance regression in GCC 4.8 and later versions.

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59371

Jakub Jelinek  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #19 from Jakub Jelinek  ---
(In reply to Steve Ellcey from comment #15)
> I am not sure yet where and how to improve this automatically but I have
> found an interesting hand optimization that could point to a way to fix
> this.  If I change the original function:

Perhaps tree-ssa-loop-niter.c could figure out that the IV has this kind of
behavior and some loop optimization could then version the loop - one predicted
likely with finite number of iterations and another one infinite.
Honza?

[Bug tree-optimization/77450] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors

2017-01-24 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450

--- Comment #11 from rguenther at suse dot de  ---
On Tue, 24 Jan 2017, clyon at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450
> 
> Christophe Lyon  changed:
> 
>What|Removed |Added
> 
>  CC||clyon at gcc dot gnu.org
> 
> --- Comment #10 from Christophe Lyon  ---
> The new testcase pr77450.c fails to compile on aarch64/arm (in gcc-5-branch).
> 
> I'm seeing:
> testsuite/gcc.dg/pr77450.c:10:1: internal compiler error: in verify_ssa, at
> tree-ssa.c:945
> 0xc51485 verify_ssa(bool, bool)
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-ssa.c:945
> 0x994fbd execute_function_todo
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:1966
> 0x994b4d do_per_function
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:1658
> 0x996483 execute_todo
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:2016

Somehow the actual patch hunk got lost (and I forgot to enable checking
during bootstrap).  Fix in testing.

[Bug target/59371] [5/6/7 Regression] Performance regression in GCC 4.8 and later versions.

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59371

--- Comment #20 from Richard Biener  ---
Yes, versioning for niter analysis is something that came up elsewhere as well.
 Note we likely want sth like the loop-vectorized builtin so we can record
that both are versions of each other (so we can scrap one if both end up
"the same").  Or maybe simply record this in the loop struct (copy-of-loop-N).

[Bug preprocessor/79210] "internal compiler error: in get_substring_ranges_for_loc" processing -Wformat-signedness warning

2017-01-24 Thread arnd at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79210

Arnd Bergmann  changed:

   What|Removed |Added

Version|7.0 |7.0.1

--- Comment #2 from Arnd Bergmann  ---
I updated to the latest checkout (r244860) and tried again with
"arm-linux-gnueabi-gcc-7.0.1 -Wformat -Wformat-signedness" and
"x86_64-linux-gcc-7.0.1 -Wformat -Wformat-signedness", which both still have
the problem.

Note that it only shows up when preprocessing and compiling together, not if
you first preprocess and then compile!

[Bug target/77468] [7 Regression] C-ray regression on Aarch64

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77468

Richard Biener  changed:

   What|Removed |Added

 Target|aarch64-linux-gnu   |aarch64-linux-gnu,
   ||x86_64-*-*
   Host|aarch64-linux-gnu   |
  Build|aarch64-linux-gnu   |

--- Comment #10 from Richard Biener  ---
http://gcc.opensuse.org/c++bench-czerny/c-ray/ also shows regressions at
revision ranges r239336-r239387 and r243991-r243996 (on x86_64)

[Bug target/77468] [7 Regression] C-ray regression on Aarch64

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77468

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #11 from Richard Biener  ---
The recent 2nd bump on x86_64 is from


r243995 | hubicka | 2017-01-01 16:40:29 +0100 (Sun, 01 Jan 2017) | 7 lines


PR middle-end/77484
* predict.def (PRED_CALL): Update hitrate.
(PRED_INDIR_CALL, PRED_POLYMORPHIC_CALL): New predictors.
* predict.c (tree_estimate_probability_bb): Split CALL predictor
into direct/indirect/polymorphic variants.

build uses -O3 -ffast-math -funroll-loops -march=native (core-avx2 in this
case)

[Bug target/79211] New: ICE in extract_insn, at recog.c:2311

2017-01-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79211

Bug ID: 79211
   Summary: ICE in extract_insn, at recog.c:2311
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
CC: meissner at gcc dot gnu.org, segher at gcc dot gnu.org,
wschmidt at gcc dot gnu.org
  Target Milestone: ---
Target: powerpc64-suse-linux

$ cat tc.i
typedef struct
{
  float z, w
} graphene_simd4f_t;
a;
fn1 (graphene_simd4f_t p1) { fn2 (a < p1.w ? a : p1.w); }

$ ./xgcc -B. tc.i -ffast-math -O2 -mcpu=power7

tc.i:6:1: error: unrecognizable insn:
 fn1 (graphene_simd4f_t p1) { fn2 (a < p1.w ? a : p1.w); }
 ^~~
(insn 29 28 13 2 (set (reg:SF 162)
(if_then_else:SF (ge (reg:SF 175)
(const_double:SF 0.0 [0x0.0p+0]))
(reg:SF 3 3 [ p1+4 ])
(reg:SF 164))) "tc.i":6 -1
 (expr_list:REG_DEAD (reg:SF 175)
(expr_list:REG_DEAD (reg:SF 164)
(expr_list:REG_DEAD (reg:SF 3 3 [ p1+4 ])
(nil)
tc.i:6:1: internal compiler error: in extract_insn, at recog.c:2311
0xaef948 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/rtl-error.c:108
0xaef979 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/rtl-error.c:116
0xac0e01 extract_insn(rtx_insn*)
../../gcc/recog.c:2311
0x9aef79 scan_one_insn
../../gcc/ira-costs.c:1446
0x9aef79 process_bb_for_costs
../../gcc/ira-costs.c:1607
0x9b0158 find_costs_and_classes
../../gcc/ira-costs.c:1714
0x9b157a ira_set_pseudo_classes(bool, _IO_FILE*)
../../gcc/ira-costs.c:2259
0x113bbe3 alloc_global_sched_pressure_data
../../gcc/haifa-sched.c:7230
0x113bbe3 sched_init()
../../gcc/haifa-sched.c:7383
0x113d1cd haifa_sched_init()
../../gcc/haifa-sched.c:7395
0xb02609 schedule_insns()
../../gcc/sched-rgn.c:3490
0xb02de3 schedule_insns()
../../gcc/sched-rgn.c:3484
0xb02de3 rest_of_handle_sched
../../gcc/sched-rgn.c:3703
0xb02de3 execute
../../gcc/sched-rgn.c:3811

[Bug target/79211] ICE in extract_insn, at recog.c:2311

2017-01-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79211

Martin Liška  changed:

   What|Removed |Added

   Target Milestone|--- |7.0
  Known to fail||7.0

[Bug tree-optimization/72785] [7 Regression] kernel build error since r236831

2017-01-24 Thread jgreenhalgh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785

--- Comment #28 from James Greenhalgh  ---
> As far as I can tell the kernel is the only project where this issue ever
> popped up. The fix is straightforward. It just needs to be send to the
> correct kernel maintainer.

Right, but getting the patch in mainline is the easy bit! This bug hits many
released kernels.

> Why do you think this case is any different from any other buggy application
> code that needs adjustments as gcc improves?

In most cases we improve GCC to exploit well defined behaviors of the standard.
In this case we created defined __builtin_constant_p with insufficient
documentation to allow a user to reasonably predict the surprising behavior
shown in this testcase.

GCC has created a path which will never be executed and used that to introduce
a constant which does not exist in the source. Unless you know what
jump-threading can do, this transformation isn't obvious.

[Bug libstdc++/79206] string_view operator== could do an early exit if sizes differ

2017-01-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79206

--- Comment #1 from Jonathan Wakely  ---
Author: redi
Date: Tue Jan 24 12:00:47 2017
New Revision: 244865

URL: https://gcc.gnu.org/viewcvs?rev=244865&root=gcc&view=rev
Log:
PR libstdc++/79206 check string_view sizes in operator==

PR libstdc++/79206
* include/experimental/string_view (operator==): Check sizes first.
* include/std/string_view (operator==): Likewise.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/experimental/string_view
trunk/libstdc++-v3/include/std/string_view

[Bug libstdc++/79206] string_view operator== could do an early exit if sizes differ

2017-01-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79206

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |5.5

--- Comment #2 from Jonathan Wakely  ---
Fixed on trunk so far.

[Bug preprocessor/79210] "internal compiler error: in get_substring_ranges_for_loc" processing -Wformat-signedness warning

2017-01-24 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79210

--- Comment #3 from David Malcolm  ---
input.c:1398 is:

  gcc_assert (line_width >= (start.column - 1 + literal_length));

which was the one failing in PR 78569.

Could be due to a different root cause, though; I'll take a look.

[Bug target/47103] i386 options have multi-line descriptions

2017-01-24 Thread goeran at uddeborg dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47103

Göran Uddeborg  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Göran Uddeborg  ---
This appears to have been fixed in 7.1-b20170101.

[Bug translation/40883] [meta-bug] Translation breakage with trivial fixes

2017-01-24 Thread goeran at uddeborg dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40883
Bug 40883 depends on bug 47103, which changed state.

Bug 47103 Summary: i386 options have multi-line descriptions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47103

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug translation/40883] [meta-bug] Translation breakage with trivial fixes

2017-01-24 Thread goeran at uddeborg dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40883
Bug 40883 depends on bug 34352, which changed state.

Bug 34352 Summary: Multi-line descriptions are not picked up for translation
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34352

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug target/34352] Multi-line descriptions are not picked up for translation

2017-01-24 Thread goeran at uddeborg dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34352

Göran Uddeborg  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Göran Uddeborg  ---
In 7.1-b20170101 the entire message apparently is picked up, even if spanning
several lines.

[Bug target/77468] [7 Regression] C-ray regression on Aarch64

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77468

--- Comment #12 from Richard Biener  ---
(In reply to Richard Biener from comment #11)
> The recent 2nd bump on x86_64 is from
> 
> 
> r243995 | hubicka | 2017-01-01 16:40:29 +0100 (Sun, 01 Jan 2017) | 7 lines
> 
> 
> PR middle-end/77484
> * predict.def (PRED_CALL): Update hitrate.
> (PRED_INDIR_CALL, PRED_POLYMORPHIC_CALL): New predictors.
> * predict.c (tree_estimate_probability_bb): Split CALL predictor
> into direct/indirect/polymorphic variants.
> 
> build uses -O3 -ffast-math -funroll-loops -march=native (core-avx2 in this
> case)

And it was good again for a short time, improving between r244241:244289
and regressing again r244382:244454.  The former adjusts PRED_CALL the latter
has the partial DSE adjustments.

[Bug translation/79208] Typo in gcc/ipa-devirt.c:1631

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79208

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-01-24
 Ever confirmed|0   |1

--- Comment #3 from Richard Biener  ---
Ah, now I checked and you are correct, the "s" should be a "a".

[Bug translation/79208] Typo in gcc/ipa-devirt.c:1631

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79208

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 12:41:07 2017
New Revision: 244866

URL: https://gcc.gnu.org/viewcvs?rev=244866&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

PR translation/79208
* ipa-devirt.c (odr_types_equivalent_p): Fix typo in diagnostic.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-devirt.c

[Bug translation/79208] Typo in gcc/ipa-devirt.c:1631

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79208

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

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

[Bug tree-optimization/77445] [7 Regression] Performance drop after r239219 on coremark test

2017-01-24 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77445

--- Comment #23 from Jan Hubicka  ---
I will implement the "allow size growth when there is a hot bb on a path"
heuristics.  We may try to get smarter on when the peeling actually helps the
unpeeled path, but that is bit hard to do because there may be many threadable
paths on the way (just as in the example) and we will never be able to fully
judge optimization oppurtunities enabled by peeling (such as better VRP
propagation, for example)

I doubt being on aggressive side here will have large effect on code size.

On unrelated note this testcase made me think that perhaps for -Ofast we want
to adjust hot/cold heuristics so we are more aggressive on guessing that BB is
hot as well (for -O2 we want to put into account code size implications, but
for -Ofast we are probably permitted to drop them)

Concerning peeling, we are probably always safe to decide to peel when the
transformation decreases code size which is the case of all those early
transforms I looked into (about 200-300 out of 700 on tramp3d). In fact such
complete peeling ought to happen somewhere in the early pass queue. 
We can punt on non-size-decreasing peelings leaving them to dedicated pass. The
loop peeling pass has its own way on predicting if something optimizes away. It
does take into account induction variables but no phis that happens to be
constant across the peeled path. Perhaps it should be merged with jump threader
and the analysis part should be done in a common way.
Backward threader should likely get smarter over time, taking into account, for
example, the value ranges and this way both passes will benefit.

[Bug tree-optimization/79159] [7 regression] spurious array-bounds warning

2017-01-24 Thread amker at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79159

--- Comment #7 from amker at gcc dot gnu.org ---
Author: amker
Date: Tue Jan 24 13:09:27 2017
New Revision: 244868

URL: https://gcc.gnu.org/viewcvs?rev=244868&root=gcc&view=rev
Log:
PR tree-optimization/79159
* tree-ssa-loop-niter.c (get_cst_init_from_scev): New function.
(record_nonwrapping_iv): Imporve boundary using above function if no
value range information.

gcc/testsuite
PR tree-optimization/79159
* g++.dg/tree-ssa/pr79159.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/tree-ssa/pr79159.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-loop-niter.c

[Bug c++/68727] [5/6/7 regression] invalid offsetof expressions accepted

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68727

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
This changed with r215070.
The problem with the move is that build_class_member_access_expr when
diagnosing this saw object_type of B, while finish_offsetof sees
((struct A *) (struct B *) 0B + (sizetype) *(long int *) (((struct B *)
0B)->_vptr.B + 18446744073709551592))->i
as expr, where object is INDIRECT_REF with type A.
But expr is unfortunately a result of folding, so trying to discover the
original type used in __builtin_offsetof (such as looking for NOP_EXPR of
null_pointer_node and using type from that) might be too unreliable.
Consider
struct A { int i[2]; };
struct B: virtual A { };
struct C: virtual A { };
__SIZE_TYPE__ a[] = { __builtin_offsetof (B, A::i[(__SIZE_TYPE__)(&((C
*)__null)->A::i)]) };
where there is both (B *) 0B and (C *) 0B in the expression.
Another option is to pass the original object (i.e. (B *) 0B in this case) to
finish_offsetof in addition to expr, but then we need to stick it into
OFFSETOF_EXPR as well.

[Bug target/46676] ix86_option_override_internal i18n problems

2017-01-24 Thread goeran at uddeborg dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46676

Göran Uddeborg  changed:

   What|Removed |Added

 CC||goeran at uddeborg dot se

--- Comment #1 from Göran Uddeborg  ---
It seems this is fixed in 7.1-b20170101.  Maybe the bug can be closed?

[Bug target/79197] [5/6/7 Regression] ICE in extract_insn in gcc/recog.c:2311

2017-01-24 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79197

--- Comment #5 from Martin Liška  ---
Probably duplicate test-case for C++:

template  class A
{
public:
  operator bool ();
  T *operator-> ();
  template  A m_fn1 ();
  T *d;
};
class B
{
public:
  typedef A Ptr;
};
template  T constant_value (long long *);
class C
{
public:
  typedef A Ptr;
  long long value___trans_tmp_1_0;
  template 
  ValueType
  m_fn2 ()
  {
return constant_value (&value___trans_tmp_1_0);
  }
};
class D
{
  B::Ptr m_lastType;
  void m_fn3 ();
};
void
D::m_fn3 ()
{
  B::Ptr conditionType, leftType;
  if (C::Ptr condition = conditionType.m_fn1 ())
if (condition->m_fn2 ())
  m_lastType = leftType;
}

./xgcc -B. tc.ii
tc.ii: In member function ‘ValueType C::m_fn2() [with ValueType = long unsigned
int]’:
tc.ii:25:3: error: unrecognizable insn:
   }
   ^
(insn 11 10 14 2 (set (reg:DI 157 [ _7 ])
(unsigned_fix:DI (reg:DF 159))) "tc.ii":24 -1
 (nil))
tc.ii:25:3: internal compiler error: in extract_insn, at recog.c:2311
0xcddaa8 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/rtl-error.c:108
0xcddad9 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/rtl-error.c:116
0xcaf401 extract_insn(rtx_insn*)
../../gcc/recog.c:2311
0xa7f5e3 instantiate_virtual_regs_in_insn
../../gcc/function.c:1589
0xa7f5e3 instantiate_virtual_regs
../../gcc/function.c:1957
0xa7f5e3 execute
../../gcc/function.c:2006

[Bug debug/78363] [7 Regression] ICE in in force_type_die, at dwarf2out.c:24864

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78363

--- Comment #7 from Richard Biener  ---
(In reply to Jakub Jelinek from comment #6)
> I think I'd prefer the second hunk (but it needs to go omp-expand.c instead),
> guarded with if (!gimple_in_ssa_p (cfun)), so that it is really done only
> early.  It should likely be done in expand_omp_target too, not sure about
> grid_expand_target_grid_body, Martin?).  And for omp_cpyfn already in
> omp-low.c's finalize_task_copyfn.  Perhaps best spot for the debug early
> hook is close to the cgraph_node::add_new_function calls in omp*.c.

Not sure I understand the finalize_task_copyfn place -- it's important to
generate early debug before outlining anything (any part of the fns BLOCK
tree).  I think the following catches all of those, the taskreg one is
enough to fix the testcase (testcases for the others would be nice to have).

Thus the following is what I am going to bootstrap/test:

Index: gcc/omp-expand.c
===
--- gcc/omp-expand.c(revision 244867)
+++ gcc/omp-expand.c(working copy)
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3.
 #include "gomp-constants.h"
 #include "gimple-pretty-print.h"
 #include "hsa-common.h"
+#include "debug.h"


 /* OMP region information.  Every parallel and workshare
@@ -1305,6 +1306,11 @@ expand_omp_taskreg (struct omp_region *r
   else
block = gimple_block (entry_stmt);

+  /* Make sure to generate early debug for the function before
+ outlining anything.  */
+  if (! gimple_in_ssa_p (cfun))
+   (*debug_hooks->early_global_decl) (cfun->decl);
+
   new_bb = move_sese_region_to_fn (child_cfun, entry_bb, exit_bb, block);
   if (exit_bb)
single_succ_edge (new_bb)->flags = EDGE_FALLTHRU;
@@ -7016,6 +7022,11 @@ expand_omp_target (struct omp_region *re
  gsi_remove (&gsi, true);
}

+  /* Make sure to generate early debug for the function before
+ outlining anything.  */
+  if (! gimple_in_ssa_p (cfun))
+   (*debug_hooks->early_global_decl) (cfun->decl);
+
   /* Move the offloading region into CHILD_CFUN.  */

   block = gimple_block (entry_stmt);
@@ -7589,6 +7600,11 @@ grid_expand_target_grid_body (struct omp
   init_tree_ssa (cfun);
   pop_cfun ();

+  /* Make sure to generate early debug for the function before
+ outlining anything.  */
+  if (! gimple_in_ssa_p (cfun))
+(*debug_hooks->early_global_decl) (cfun->decl);
+
   tree old_parm_decl = DECL_ARGUMENTS (kern_fndecl);
   gcc_assert (!DECL_CHAIN (old_parm_decl));
   tree new_parm_decl = copy_node (DECL_ARGUMENTS (kern_fndecl));

[Bug tree-optimization/77450] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors

2017-01-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77450

--- Comment #12 from Richard Biener  ---
Author: rguenth
Date: Tue Jan 24 13:56:50 2017
New Revision: 244870

URL: https://gcc.gnu.org/viewcvs?rev=244870&root=gcc&view=rev
Log:
2017-01-24  Richard Biener  

Backport from mainline
2016-09-06  Richard Biener  

PR c/77450
* c-common.c (c_common_mark_addressable_vec): Handle
COMPOUND_LITERAL_EXPR.

Modified:
branches/gcc-5-branch/gcc/c-family/c-common.c

[Bug target/78516] [7 Regression] ICE in lra_assign for e500v2

2017-01-24 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78516

--- Comment #26 from joseph at codesourcery dot com  ---
As of r244815 I don't see the ICE building glibc.  193 FAILs in gcc.sum, 
60 in g++.sum, which is comparable to the results I reported with the LRA 
patches.  I don't get ICEs from either of the previous .i files either.  
So while I don't know what fixed the LRA issue(s) or caused them to go 
latent, I see no sign of them being visible at present.

[Bug c++/68727] [5/6/7 regression] invalid offsetof expressions accepted

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68727

--- Comment #4 from Jakub Jelinek  ---
Created attachment 40572
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40572&action=edit
gcc7-pr68727.patch

Untested patch that implements the extra finish_offsetof argument.

[Bug target/71399] [5/6/7 Regression] 5.3.0 bootstrap comparison failure on arm-linux-gnueabihf

2017-01-24 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71399

wilco at gcc dot gnu.org changed:

   What|Removed |Added

 CC||wilco at gcc dot gnu.org

--- Comment #17 from wilco at gcc dot gnu.org ---
I've backported PR78041 to GCC5 branch so it's worth trying again to see
whether this is now fixed?

[Bug target/78041] Wrong code on ARMv7 with -mthumb -mfpu=neon-fp16 -O0

2017-01-24 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78041

wilco at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #20 from wilco at gcc dot gnu.org ---
Fixed in GCC5, GCC6 and GCC7.

[Bug target/78041] Wrong code on ARMv7 with -mthumb -mfpu=neon-fp16 -O0

2017-01-24 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78041

--- Comment #19 from wilco at gcc dot gnu.org ---
Author: wilco
Date: Tue Jan 24 14:14:12 2017
New Revision: 244872

URL: https://gcc.gnu.org/viewcvs?rev=244872&root=gcc&view=rev
Log:
With -fpu=neon DI mode shifts are expanded after reload.  DI mode registers can 
either fully or partially overlap on both ARM and Thumb-2.  However the shift
expansion code can only deal with the full overlap case, and generates
incorrect
code for partial overlaps.  The fix is to add new variants that support either
full overlap or no overlap.

Backport from mainline
gcc/
PR target/78041
* config/arm/neon.md (ashldi3_neon): Add "r 0 i" and "&r r i" variants.
Remove partial overlap check for shift by 1.
(ashldi3_neon): Likewise.
testsuite/
* gcc.target/arm/pr78041.c: New test.

Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/arm/neon.md
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug target/78041] Wrong code on ARMv7 with -mthumb -mfpu=neon-fp16 -O0

2017-01-24 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78041

Richard Earnshaw  changed:

   What|Removed |Added

   Target Milestone|--- |5.5

[Bug debug/78363] [7 Regression] ICE in in force_type_die, at dwarf2out.c:24864

2017-01-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78363

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek  ---
For the expand_omp_target hunk, a testcase would be e.g.

int
main ()
{
  int n = 0;
#pragma omp target map(tofrom:n)
#pragma omp for reduction (+: n)
  for (int i = [](){ return 3; }(); i < 10; ++i)
n++;
  if (n != 7)
__builtin_abort ();
}

For tasking as opposed to parallel, testcase that ICEs is e.g.:

int
main ()
{
  int n = 0;
#pragma omp task shared (n)
  for (int i = [](){ return 3; }(); i < 10; ++i)
n = i;
#pragma omp taskwait
  if (n != 7)
__builtin_abort ();
}

For grid, you want Martin to write a testcase ;).
Regarding finalize_task_copyfn, this is for an artificial function created for
constructors of firstprivate vars in task, like:
struct S { S (); ~S (); S (const S &); };
void foo (S &);

void
bar ()
{
  S s;
#pragma omp task firstprivate (s)
  foo (s);
}
The *cpyfn* for this looks like:
  try
{
  {
.omp_data_o.3_1 = .omp_data_o;
_2 = &.omp_data_o.3_1->s;
_3 = .omp_data_i->s;
S::S (_2, _3);
return;
  }
}
  catch
{
  <<>>
}
and is not actually outlined from the original function, but rather constructed
from scratch.  Couldn't get ICE on it, so let's ignore that for now.

[Bug c++/64697] C++11 thread_local: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for N::ptd'

2017-01-24 Thread vhaisman at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697

--- Comment #17 from Václav Haisman  ---
This is still an issue in 2017 with GCC 5.4.0.

[Bug target/77468] [7 Regression] C-ray regression on Aarch64

2017-01-24 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77468

--- Comment #13 from Aldy Hernandez  ---
The aarch64-linux-gnu regression originally reported for -mcpu=cortex-a53 was
caused by:

commit 08993ad1c669cab64baf352f79cd7f8584dd8e0c
Author: jgreenhalgh 
Date:   Thu Oct 1 09:33:40 2015 +

[Patch 2/2 ARM/AArch64] Add a new Cortex-A53 scheduling model

* config/arm/aarch-common-protos.h
(aarch_accumulator_forwarding): New.
(aarch_forward_to_shift_is_not_shifted_reg): Likewise.
* config/arm/aarch-common.c (aarch_accumulator_forwarding): New.
(aarch_forward_to_shift_is_not_shifted_reg): Liekwise.
* config/arm/cortex-a53.md: Rewrite.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228324
138bc75d-0d04-0410-961f-82ee72b054a4

[Bug target/77468] [7 Regression] C-ray regression on Aarch64

2017-01-24 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77468

--- Comment #14 from Aldy Hernandez  ---
Since the culprit for the reported regression is aarch64 specific, I think we
should open an independent x86-64 PR (or an architecture independent PR if the
other reported problem by Richi is reproducible on multiple architectures).

[Bug target/77468] [7 Regression] C-ray regression on Aarch64

2017-01-24 Thread jgreenhalgh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77468

--- Comment #15 from James Greenhalgh  ---
(In reply to Aldy Hernandez from comment #13)
> The aarch64-linux-gnu regression originally reported for -mcpu=cortex-a53
> was caused by:
> 
> commit 08993ad1c669cab64baf352f79cd7f8584dd8e0c
> Author: jgreenhalgh 
> Date:   Thu Oct 1 09:33:40 2015 +
> 
> [Patch 2/2 ARM/AArch64] Add a new Cortex-A53 scheduling model
> 
> * config/arm/aarch-common-protos.h
> (aarch_accumulator_forwarding): New.
> (aarch_forward_to_shift_is_not_shifted_reg): Likewise.
> * config/arm/aarch-common.c (aarch_accumulator_forwarding): New.
> (aarch_forward_to_shift_is_not_shifted_reg): Liekwise.
> * config/arm/cortex-a53.md: Rewrite.
> 
> 
> 
> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228324
> 138bc75d-0d04-0410-961f-82ee72b054a4

Could you dump me the assembly of the hot loop before and after that change -
I'll see if we're doing anything particularly offensive with the scheduling,
though I still don't have access to the source code for this benchmark so a
reduced testcase would be appreciated.

[Bug target/71767] Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler

2017-01-24 Thread fxcoudert at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71767

--- Comment #57 from Francois-Xavier Coudert  ---
(In reply to Iain Sandoe from comment #55)
> nope, it needs back-porting to 6.x and 5.x - will do that after it's been on
> trunk a while.

Is backport to 5.x still planned?

[Bug tree-optimization/56049] [7 Regression] Simplification to constants not done

2017-01-24 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56049

--- Comment #21 from Jeffrey A. Law  ---
c#19 (WRT guality regressing) was for a different BZ.  Sorry.

  1   2   >