Patchwork [tree-optimization] : Fix PR46142

mail settings
Submitter Uros Bizjak
Date Oct. 31, 2010, 7:16 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/69699/
State New
Headers show


Uros Bizjak - Oct. 31, 2010, 7:16 a.m.

We have to enlarge dt array by one in vectorizable_call function to
accommodate extra function argument for FMA. Please also see the PR

For some reason, valgrind didn't catch this uninitialized situation,
but the one-liner patch is obvious.

2010-10-31  Uros Bizjak  <>

	PR tree-optimization/46142
	* tree-vect-stmts.c (vectorizable_call): Enlarge dt array to
	accommodate third function argument.

Tested on x86_64-pc-linux-gnu {,-m32} and i686-pc-linux-gnu where the
patch fixes the failure.

Patch was committed to SVN mainline as obvious.




Index: tree-vect-stmts.c
--- tree-vect-stmts.c	(revision 166104)
+++ tree-vect-stmts.c	(working copy)
@@ -1308,7 +1308,8 @@  vectorizable_call (gimple stmt, gimple_s
   loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
   tree fndecl, new_temp, def, rhs_type;
   gimple def_stmt;
-  enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
+  enum vect_def_type dt[3]
+    = {vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type};
   gimple new_stmt = NULL;
   int ncopies, j;
   VEC(tree, heap) *vargs = NULL;