delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/11/29/05:25:00

From: burkarth AT prodad DOT de (Holger Burkarth)
Subject: Gcc
29 Nov 1998 05:25:00 -0800 :
Message-ID: <yam7637.1925.136553584.cygnus.gnu-win32@mail.toplink.net>
Reply-To: Holger Burkarth <burkarth AT prodad DOT de>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019