]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/ccmp.c
This patch fixes an exponential issue in ccmp.c.
authorWilco Dijkstra <wdijkstr@arm.com>
Thu, 4 Feb 2016 18:23:35 +0000 (18:23 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Thu, 4 Feb 2016 18:23:35 +0000 (18:23 +0000)
commite0b059b1dd3c284a256833a564f22b8e6d5a5d5d
treea88004c404d55761241e320b6f30461513a552ca
parent56f3bb3822dfc1c10df8d561d7bb6ba55f2e1e06
This patch fixes an exponential issue in ccmp.c.

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.

From-SVN: r233145
gcc/ChangeLog
gcc/ccmp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr69619.c [new file with mode: 0644]