This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR69619: Fix exponential issue in ccmp.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]