public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][Cilkplus, Cilkplus-4_7-branch] Patch to fix a elemental function bug
@ 2012-03-20  0:27 Iyer, Balaji V
  0 siblings, 0 replies; only message in thread
From: Iyer, Balaji V @ 2012-03-20  0:27 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

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.

[-- Attachment #2: patch_to_fix_default_Values.txt --]
[-- Type: text/plain, Size: 1503 bytes --]

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.iyer@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.iyer@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"))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-20  0:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20  0:27 [PATCH][Cilkplus, Cilkplus-4_7-branch] Patch to fix a elemental function bug Iyer, Balaji V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).