constant string changed

2010-10-06 Thread Phung Nguyen
Dear all, When porting GCC on xc16x, I met a problem with a constant string. The following is the C code: #include "stdio.h" int main () { printf ("c\n"); } And the following is the generated assembly: .xc16x .section .rodata .LC0: .ascii "c\0" .

Re: constant string changed

2010-10-06 Thread Jakub Jelinek
On Wed, Oct 06, 2010 at 09:59:29PM +0700, Phung Nguyen wrote: > When porting GCC on xc16x, I met a problem with a constant string. The > following is the C code: > #include "stdio.h" > > int main () { > > printf ("c\n"); > } > And the following is the generated assembly: > .xc16

Re: constant string changed

2010-10-06 Thread Phung Nguyen
How can I turn this optimization off? Phung On Wed, Oct 6, 2010 at 10:04 PM, Jakub Jelinek wrote: > On Wed, Oct 06, 2010 at 09:59:29PM +0700, Phung Nguyen wrote: >> When porting GCC on xc16x, I met a problem with a constant string. The >> following is the C code: >> #include "stdio.h" >> >> int

Re: constant string changed

2010-10-06 Thread Richard Guenther
On Wed, Oct 6, 2010 at 11:34 PM, Phung Nguyen wrote: > How can I turn this optimization off? Use -fno-builtin-printf. Richard. > Phung > > On Wed, Oct 6, 2010 at 10:04 PM, Jakub Jelinek wrote: >> On Wed, Oct 06, 2010 at 09:59:29PM +0700, Phung Nguyen wrote: >>> When porting GCC on xc16x, I met

Re: constant string changed

2010-10-06 Thread Robert Dewar
On 10/6/2010 5:43 PM, Richard Guenther wrote: On Wed, Oct 6, 2010 at 11:34 PM, Phung Nguyen wrote: How can I turn this optimization off? Use -fno-builtin-printf. I'm curious, it's obviously a correct optimization, so why would you want to turn if off?

Re: constant string changed

2010-10-06 Thread Matt Thomas
On Oct 6, 2010, at 3:02 PM, Robert Dewar wrote: > On 10/6/2010 5:43 PM, Richard Guenther wrote: >> On Wed, Oct 6, 2010 at 11:34 PM, Phung Nguyen wrote: >>> How can I turn this optimization off? >> >> Use -fno-builtin-printf. > > I'm curious, it's obviously a correct optimization, so why > woul

Re: constant string changed

2010-10-06 Thread Robert Dewar
On 10/6/2010 6:54 PM, Matt Thomas wrote: On Oct 6, 2010, at 3:02 PM, Robert Dewar wrote: On 10/6/2010 5:43 PM, Richard Guenther wrote: On Wed, Oct 6, 2010 at 11:34 PM, Phung Nguyen wrote: How can I turn this optimization off? Use -fno-builtin-printf. I'm curious, it's obviously a corre