This patch fixes an exponential issue in ccmp.c. When deciding which ccmp
commit08fd6cf566033c9ff7ebc402aa3fa41a05b40215
authorwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Feb 2016 18:23:35 +0000 (4 18:23 +0000)
committerwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Feb 2016 18:23:35 +0000 (4 18:23 +0000)
treea88004c404d55761241e320b6f30461513a552ca
parent2c794ea99ae9b6d778344963c7911b59bea70d9d
This patch fixes an exponential issue in ccmp.c.  When deciding which ccmp
expansion to use, the tree nodes gs0 and gs1 are fully expanded twice.  If
they contain more CCMP opportunities, their subtrees are also expanded twice.
When the trees are complex the expansion takes exponential time and memory.
As a workaround in GCC6 compute the cost of the first expansion early, and
only try the alternative expansion if the cost is low enough.  This rarely
affects real code, eg. SPECINT2006 has identical codesize.

2016-02-04  Wilco Dijkstra  <wdijkstr@arm.com>

    gcc/
PR target/69619
* ccmp.c (expand_ccmp_expr_1): Avoid evaluating gs0/gs1
twice when complex.

    gcc/testsuite/
PR target/69619
* gcc.dg/pr69619.c: Add new test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233145 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/ccmp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr69619.c [new file with mode: 0644]