This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Optimizer questions/issues with EBCDIC i370/s390 modes.
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: dpitts at cozx dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 22 Aug 2002 10:41:52 -0400 (EDT)
- Subject: Re: Optimizer questions/issues with EBCDIC i370/s390 modes.
- References: <200208212111.RAA28120@makai.watson.ibm.com>
> 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);