re PR target/84272 (AddressSanitizer: heap-use-after-free ../../gcc/config/aarch64...
authorJakub Jelinek <jakub@redhat.com>
Fri, 16 Feb 2018 09:26:27 +0000 (10:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 16 Feb 2018 09:26:27 +0000 (10:26 +0100)
commit1e6d3b10e3a4eb554f1275ac8a0d7ee30f31f476
treed0a8c71cdc7dc0e301af120598d15e5c900705df
parentab67039ccd31de6d0192d4560ff971ff0af81726
re PR target/84272 (AddressSanitizer: heap-use-after-free ../../gcc/config/aarch64/cortex-a57-fma-steering.c:519 in fma_node::get_parity())

PR target/84272
* config/aarch64/cortex-a57-fma-steering.c (fma_forest::merge_forest):
Use ++iter rather than iter++ for std::list iterators.
(func_fma_steering::dfs): Likewise.  Don't delete nodes right away,
defer deleting them until all nodes in the forest are processed.  Do
free even leaf nodes.  Change to_process into auto_vec.

* g++.dg/opt/pr84272.C: New test.

From-SVN: r257727
gcc/ChangeLog
gcc/config/aarch64/cortex-a57-fma-steering.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr84272.C [new file with mode: 0644]