From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12486 invoked by alias); 9 Feb 2011 04:54:17 -0000 Received: (qmail 12478 invoked by uid 22791); 9 Feb 2011 04:54:16 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_CP X-Spam-Check-By: sourceware.org Received: from mail-px0-f175.google.com (HELO mail-px0-f175.google.com) (209.85.212.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Feb 2011 04:54:09 +0000 Received: by pxi17 with SMTP id 17so1620765pxi.20 for ; Tue, 08 Feb 2011 20:54:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.133.10 with SMTP id g10mr17769795wfd.185.1297227247905; Tue, 08 Feb 2011 20:54:07 -0800 (PST) Received: by 10.142.99.2 with HTTP; Tue, 8 Feb 2011 20:54:07 -0800 (PST) Date: Wed, 09 Feb 2011 05:17:00 -0000 Message-ID: Subject: suggestion for GCC (1) From: ali hagigat To: gcc-help@gcc.gnu.org, Ian Lance Taylor , david@westcontrol.com, thomas.martitz@student.htw-berlin.de Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00159.txt.bz2 >From our previous discussion I only became confused and suspicious about my previous knowledge i collected from my emails to the mailing list and raised new questions: 1) What is a built-in function in gcc (and in the manual of gcc)? Is it a function which its C/Assembly code is inside the code of the compiler? or Its code is some where on hard disk and inside a library function? or the code of the built in function is on hard disk but when we build a program we do not need to link the library of that function and the compiler automatically finds the code of that function from a library function on hard disk and adds it to our program automatically? I raised different scenarios about what a built in is, unfortunately the manual of gcc does not explain these facts at all, leaves the reader completely confused. 2) Ian said in one message that some supporting routine is necessary for nested functions. What does a nested function mean? It means we have a C function and then it calls another function inside by its name? 3) Ian told that the functions like memcpy should be optimized and they are target dependent and we do not make them as built in. It is unacceptable in my opinion. We are talking about a great new feature for gcc, embedded programming and writing firmwares, not optimization, which gives gcc a great power and it is a new branch of programming. The fact that the code may be slower or it takes more memory is a secondary trivial problem in this case to me. Besides compiler must be able to translate a code for a specific CPU, why gcc is dependent to some thing except CPU?!!! Dependent to what? (To me gcc has a bug which is dependent to some definitions outside its code, It is a software issue which can be corrected) 4) does gcc have any extension to produce stand alone code in open source space you may aware of( for a free standing environment without libraries). 5) Ian said: "The compiler does by default treat functions like memcpy as builtins, and ..." If memcpy is built in why gcc still generates some calls to memcpy and memcpy should be provided some how as the manual of gcc says? 6) Where is memcpy at last? is it in libgcc, libc or it is built in? 7) Can i link only libgcc with my code in case of -nostdlib? and every thing is OK? I write libgcc.a on my command line and every thing is OK? 8) When exactly compiler generates call to mem functions like memcpy, memcmp, memset, memmove? Would you please write a complete list of the cases when compiler does that for -nostdlib. Why the manual of gcc does not talk about such an important subject.