[Bug tree-optimization/85244] [6/7 Regression] Bad optimisation with flexible array member (may be related to -ftree-dominator-opts)

2018-04-26 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85244

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Thu Apr 26 10:00:24 2018
New Revision: 259670

URL: https://gcc.gnu.org/viewcvs?rev=259670=gcc=rev
Log:
2018-04-26  Richard Biener  

Backport from mainline
2018-04-09  Richard Biener  

PR tree-optimization/85284
* tree-ssa-loop-niter.c (number_of_iterations_exit_assumptions):
Only use the niter constraining form of simple_iv when the exit
is always executed.

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

2018-04-06  Richard Biener  

PR middle-end/85244
* tree-dfa.c (get_ref_base_and_extent): Reset seen_variable_array_ref
after seeing a component reference with an adjacent field.  Treat
refs to arrays at struct end of external decls similar to
refs to unconstrained commons.

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

2018-04-04  Richard Biener  

PR tree-optimization/85168
* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address): Avoid
propagating abnormals.

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

2018-03-16  Richard Biener  

PR c/84873
* c-gimplify.c (c_gimplify_expr): Revert previous change.  Instead
unshare the possibly folded expression.

2018-03-15  Richard Biener  

PR c/84873
* c-gimplify.c (c_gimplify_expr): Do not fold expressions.

* c-c++-common/pr84873.c: New testcase.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/pr84873.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr85168.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr85244-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr85244-2.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr85284.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-gimplify.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-dfa.c
branches/gcc-7-branch/gcc/tree-ssa-loop-niter.c
branches/gcc-7-branch/gcc/tree-ssa-sccvn.c

[Bug tree-optimization/85244] [6/7 Regression] Bad optimisation with flexible array member (may be related to -ftree-dominator-opts)

2018-04-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85244

Richard Biener  changed:

   What|Removed |Added

  Known to work||8.0
Summary|[6/7/8 Regression] Bad  |[6/7 Regression] Bad
   |optimisation with flexible  |optimisation with flexible
   |array member (may be|array member (may be
   |related to  |related to
   |-ftree-dominator-opts)  |-ftree-dominator-opts)

--- Comment #9 from Richard Biener  ---
Fixed on trunk sofar.