Hello Everyone, This patch is for the Cilkplus and Cilkplus-4_7-branch affecting mainly the C compiler. it will fix a crash when a default vector length or processor name is not given.
Thanks, Balaji V. Iyer.
diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index b2d90e0..35f052f 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,3 +1,9 @@ +2012-03-19 Balaji V. Iyer <balaji.v.i...@intel.com> + + * elem-function.c (find_processor_code): Returned default value when + no value is given. + (find_vlength_code): Likewise. + 2012-03-18 Balaji V. Iyer <balaji.v.i...@intel.com> * c-array-notation.c (expand_array_notation_exprs): New function. diff --git a/gcc/elem-function.c b/gcc/elem-function.c index a5a7b61..b1bb22e 100644 --- a/gcc/elem-function.c +++ b/gcc/elem-function.c @@ -136,7 +136,7 @@ static char * find_processor_code (elem_fn_info *elem_fn_values) { if (!elem_fn_values || !elem_fn_values->proc_type) - return NULL; + return xstrdup ("B"); if (!strcmp (elem_fn_values->proc_type, "pentium_4")) return xstrdup ("B"); @@ -161,7 +161,7 @@ find_vlength_code (elem_fn_info *elem_fn_values) { char *vlength_code = (char *) xmalloc (sizeof (char) * 10); if (!elem_fn_values) - return NULL; + return sprintf (vlength_code, "4"); memset (vlength_code, 10, 0); @@ -170,7 +170,7 @@ find_vlength_code (elem_fn_info *elem_fn_values) else { if (!strcmp (elem_fn_values->proc_type, "pentium_4")) - sprintf(vlength_code,"4"); + sprintf (vlength_code,"4"); else if (!strcmp (elem_fn_values->proc_type, "pentium4_sse3")) sprintf (vlength_code, "4"); else if (!strcmp (elem_fn_values->proc_type, "core2_duo_ssse3"))