[tree-optimization] : Fix PR46142

Message ID AANLkTimBLbmSF5ncj3Guo1Q7O5-3d-ez41LBzBg_Ah-Y@mail.gmail.com
State New
Headers show

Commit Message

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  <ubizjak@gmail.com>

	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.

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46142#c4



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;