re PR tree-optimization/85244 (Bad optimisation with flexible array member (may be...
authorRichard Biener <rguenther@suse.de>
Fri, 6 Apr 2018 11:47:18 +0000 (11:47 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 6 Apr 2018 11:47:18 +0000 (11:47 +0000)
commitef2e5ec2d4dbcd865bd62fd887b89e7a42f66222
tree6b9a5f6c6431c26e9dbdbeff5e32be6928d26f55
parent5a98025d8fdd5274cd6e5573424504c60427c56a
re PR tree-optimization/85244 (Bad optimisation with flexible array member (may be related to -ftree-dominator-opts))

2018-04-06  Richard Biener  <rguenther@suse.de>

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.

From-SVN: r259168
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr85244-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr85244-2.c [new file with mode: 0644]
gcc/tree-dfa.c