This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR69619: Fix exponential issue in ccmp.c
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>
- Date: Thu, 4 Feb 2016 01:23:26 +0100
- Subject: Re: [PATCH] PR69619: Fix exponential issue in ccmp.c
- Authentication-results: sourceware.org; auth=none
- References: <AM3PR08MB0088F9EB9D134635F586801F83D00 at AM3PR08MB0088 dot eurprd08 dot prod dot outlook dot com>
On 02/03/2016 05:35 PM, Wilco Dijkstra wrote:
- tmp2 = targetm.gen_ccmp_first (&prep_seq_2, &gen_seq_2, rcode1,
- gimple_assign_rhs1 (gs1),
- gimple_assign_rhs2 (gs1));
-
It looks like after this patch tmp2 could be used uninitialized? Should
be fixed.
+
+ /* FIXME: Temporary workaround for PR69619.
+ Avoid exponential compile time due to expanding gs0 and gs1 twice.
+ If gs0 and gs1 are complex, the cost will be high, so avoid
+ reevaluation if above an arbitrary threshold. */
+ if ((tmp == NULL) || (cost1 < 100))
Two sets of unnecessary parentheses. Also, I think the cost should be
based on COSTS_N_INSNS for proper units.
Otherwise I think this is a reasonable workaround for this stage. Ok
with these changes.
Bernd