This is the mail archive of the gcc@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: Optimizer questions/issues with EBCDIC i370/s390 modes.


 > 2. Outputing of constant strings with printf are converted to puts
 > when running native.
 > 
 > It appears that the optimizer is looking for a native \n and not
 > TARGET_NEWLINE.

Does this (as of yet untested) patch help?

2002-08-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* c-common.c (c_expand_builtin_printf): Use TARGET_NEWLINE.

Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.366
diff -u -p -r1.366 c-common.c
--- c-common.c	16 Aug 2002 23:31:03 -0000	1.366
+++ c-common.c	22 Aug 2002 14:27:06 -0000
@@ -4513,10 +4513,10 @@ c_expand_builtin_printf (arglist, target
          includes the terminating NULL in its count.  */
       else if (TREE_STRING_LENGTH (stripped_string) > 2
 	       && TREE_STRING_POINTER (stripped_string)
-	       [TREE_STRING_LENGTH (stripped_string) - 2] == '\n')
+	       [TREE_STRING_LENGTH (stripped_string) - 2] == TARGET_NEWLINE)
         {
 	  /* Create a NULL-terminated string that's one char shorter
-	     than the original, stripping off the trailing '\n'.  */
+	     than the original, stripping off the trailing TARGET_NEWLINE.  */
 	  const int newlen = TREE_STRING_LENGTH (stripped_string) - 1;
 	  char *newstr = (char *) alloca (newlen);
 	  memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);


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