Mail Archives: cygwin/1998/11/29/18:03:44
const char *Tst = "" = pointer to constant of type 'char'
const char * const Tst = "" = constant pointer to constant of type 'char'
Regards
Dan Haynes
> -----Original Message-----
> From: Holger Burkarth [mailto:burkarth AT prodad DOT de]
> Sent: Sunday, November 29, 1998 4:05 AM
> To: gnu-win32 AT cygnus DOT com
> Subject: Gcc
>
>
> Hi,
>
> i have a little question, the normaly so good
> gcc machine-code, is in any case not
> so good, what is the reason ?
>
>
>
>
> ------ Source -------
> void test2()
> {
> const char* Tst="";
>
> if(Tst != NULL) printf(Tst);
> }
>
>
>
> $ gcc main.cpp -O2 -S
>
>
>
> ------ Output -------
> .file"main.cc"
> # GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
> # (i686-pc-cygwin32) compiled by GNU C version egcs-2.91.57 19980901
> # (egcs-1.1 release).
> # options passed: -mcpu=i486 -mno-stack-arg-probe -O2
> -Wchar-subscripts
> # -Wcomment -Wimplicit -Wparentheses -Wreturn-type -Wunused
> # -Wuninitialized -Wshadow -Wwrite-strings
> -Waggregate-return -Winline
> # -fno-exceptions -fomit-frame-pointer -fverbose-asm
> # options enabled: -fdefer-pop -fomit-frame-pointer
> -fcse-follow-jumps
> # -fcse-skip-blocks -fexpensive-optimizations -fthread-jumps
> # -fstrength-reduce -fpeephole -fforce-mem -ffunction-cse -finline
> # -fkeep-static-consts -fcaller-saves -freg-struct-return -fgcse
> # -frerun-cse-after-loop -frerun-loop-opt -fschedule-insns2
> # -fsjlj-exceptions -fcommon -fverbose-asm -fgnu-linker -fregmove
> # -foptimize-register-move -fargument-alias -m80387 -mhard-float
> # -mno-soft-float -mieee-fp -mfp-ret-in-387
> -mschedule-prologue -mcpu=i686
> # -march=pentium
>
> gcc2_compiled.:
> ___gnu_compiled_cplusplus:
> .text
> LC0:
> .ascii "\0"
> .globl _Test2__Fv
>
> _Test2__Fv:
> movl $LC0,%eax
> testl %eax,%eax
> je L138 <- why this ?
> pushl %eax
> call _printf
> addl $4,%esp
> L138:
> ret
>
>
> --
> Holger Burkarth
> Software-Developer
> burkarth AT prodad DOT de
> http://www.prodad.de
>
> -
> For help on using this list (especially unsubscribing), send
> a message to
> "gnu-win32-request AT cygnus DOT com" with one line of text: "help".
>
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -