Re: Tree node questions
Brendon Costa <[EMAIL PROTECTED]> writes: > If I have a FUNCTION_DECL node that returns non-null for > DECL_TEMPLATE_INFO() then it is a template or template instantiation. > How can I tell if it is a full instantiation (I.e. not general > template or partial specialisation)? DECL_TEMPLATE_INSTANTIATION, I believe. > Does this also apply to nodes that represent template types > (structs/classes)? For them I believe you want CLASSTYPE_TEMPLATE_INSTANTIATION. > Also up to now I have been using my own "tree walker" as I seem to be > unable to get walk_tree to work as I need. I have come across a few > problems in my own tree walker and need to change it, but before I do > I thought I would see if there already exists something that works > similarly. > > Basically I would like to know the current "tree depth" and context > for the parent nodes in the tree as it is walked down. > > Is there any way of getting the current depth and node context using > walk_tree or a similar function? I don't know of any straightforward way, no. > One final question. Are there any functions and if so what types that > are skipped by gimplify_function_tree defined in gimplify.c? Every function that is going to be expanded into assembly code should go through gimplify_function_tree. gcc won't ordinarily bother to expand static functions which are not used. Ian
Re: Additional tree node questions.
Brendon Costa <[EMAIL PROTECTED]> writes: > For each FUNCTION_DECL node I find, I want to determine what its > exception specification list is. I.e. the throws() statement in its > prototype. Look at TYPE_RAISES_EXCEPTIONS (FNDECL). Ian
Abt SIMD Emulation
Hello all, For targets which doesn't have simd hardware support like fr30 , simd stuff is emulated? Is there some flags/macros in gcc to indicate that? How is it done in other targets which deosnt have the hardware support? Thanks in advance Regards, Shafi.
Re: Compile time of Expression Templates in C++
On 10/10/06, Jochen Haerdtlein <[EMAIL PROTECTED]> wrote: Hello, I am a PhD student working on the extended use of expression templates for solving partial differential equations. Thus, I did a lot of studying of expression templates papers, articles and expression templates implementations. Actually, I had some ideas for improving them for high performance platforms. Since compile time of huge expression template programs is a severe problem, I am interested in the mechanisms within g++ that are necessary to resolve the nested template constructs. Unfortunately, it is pretty hard (for me) to find any hints on that. Is there any documentation concerning the policies within gcc how the templates are resolved, instatiated, etc. ? Where is the time spent during compiling? I already started the -ftime-report option and got some information. Concerning that, about one third of the time is needed by the parser. But I would like to understand it in more detail, if possible. First I would be happy for any reaction of you, just telling me whether my interests are complete nonsense or unsolvable. Maybe, you can give me some hints, where I can find some answers, or somebody I can annoy. You may want to look at PR29433. Richard.
gcc for mvs
GCC 3.2.3 has been built for MVS 3.8, MVS/XA, OS/390, Z/OS and VM/CMS. You can find the modified source and binaries here: http://www.softlib.org/GCCMVS/gccmvs.html Only the C compiler has been ported. BFN. Paul.
Migration of Cross Compiler from gcc 3.4.6 to gcc 4.1.1
Hi all, I am upgrading my cross-compiler from 3.4.6 to 4.1.1. It has built successfully. But while running the test suites, one of the errors that i was getting was due to the below mentioned file 20020611-1.c /* PR target/6997. Missing (set_attr "cc" "none") in sleu pattern in cris.md. Testcase from hp (at) axis.com. */ int p; 5 int k; 6 unsigned int n; 7 8 void x () 9 { 10 unsigned int h; 11 12 h = n <= 30; 13 if (h) 14 p = 1; 15 else 16 p = 0; 17 18 if (h) 19 k = 1; 20 else 21 k = 0; 22 } 23 24 unsigned int n = 30; 25 26 main () 27 { 28 x (); 29 if (p != 1 || k != 1) 30 abort (); 31 exit (0); 32 } 33
GNAT, SJLJ and zero-cost exception handling
Hi, after reading [1] and [2] I'm a bit confused. I'd like to know how I should go about building GCC such that I can choose between SJLJ and ZCX at compile time, using --rts=sjlj. From [2] it looks like this is a configure-time option only. Is it necessary to configure gcc twice and produce two different libgnats? Is it necessary to install two compilers? [1] http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gnat_ugn_unw/Exception-Handling-Control.html [2] http://gcc.gnu.org/install/configure.html#TOC5 Thanks for any help. -- Ludovic Brenta.
[bugzilla] Remove libf2c component
Hi all, I'm not sure whom to write about the workings of the GCC bugzilla database, so I'm writing here and CCing Daniel Berlin, since IIRC he handles part of that work. I think it would be nice (although not high priority) to remove the libf2c component in bugzilla, since we don't ship libf2c anymore now that 3.4 branch is extinct. There are no active bugs in it, the last open bugs were closed as WONTFIX by Gabriel dos Reis. Technically, I don't know what will happen to old bugs with this component, but at least we shouldn't propose that as a component to people reporting new bugs. FX
Fwd: Migration of Cross Compiler from gcc 3.4.6 to gcc 4.1.1
Hi all, I am upgrading my cross-compiler from 3.4.6 to 4.1.1. It has built successfully. But while running the test suites, one of the errors that i was getting was due to the below mentioned file 20020611-1.c that too while optimizing for size Os. /* PR target/6997. Missing (set_attr "cc" "none") in sleu pattern in cris.md. Testcase from hp (at) axis.com. */ int p; int k; unsigned int n; void x () { unsigned int h; h = n <= 30; if (h) p = 1; else p = 0; if (h) k = 1; else k = 0; } unsigned int n = 30; main () { x (); if (p != 1 || k != 1) abort (); exit (0); } This bug was fixed previously. 1. Can i get more information on how the bug was fixed? 2. what does sleu pattern mean? Regards, Rohit
Wiki, documenting Tree SSA passes
Dear All, I am still a newbie on GCC! On the Wiki, http://gcc.gnu.org/wiki/MiddleEnd I am trying to document very briefly the passes on Gimple SSA trees I do know about the chapter 8.4 (Tree SSA passes) of the GCC internal documentation (but some of the passes are not listed there) I cannot yet submit patches to it (file gcc/doc/passes.texi) yet, because my copyright assignement form takes some time to be signed at CEA-LIST where I am working on GCC (but I think it will be signed soon). Do I understand correctly that no patch of more than 10 lines can be sent to gcc-patches@ without the FSF having recieved the copyright transfer (or assignment) paper? Is documenting the passes on the Wiki worthwile? Could some people document (in a few sentences) each pass (ie each struct tree_opt_pass defined in the source tree) if possible? Thanks for reading (and sorry for the trivial questions above) -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet aliases: basiletunesorg = bstarynknerimnet 8, rue de la Faïencerie, 92340 Bourg La Reine, France
Re: Fwd: Migration of Cross Compiler from gcc 3.4.6 to gcc 4.1.1
Rohit Arul Raj writes: > Hi all, > I am upgrading my cross-compiler from 3.4.6 to 4.1.1. It has built > successfully. But while running the test suites, one of the errors > that i was getting was due to the below mentioned file > 20020611-1.c that too while optimizing for size Os. On what arch? > > /* PR target/6997. Missing (set_attr "cc" "none") in sleu pattern in > cris.md. Testcase from hp (at) axis.com. */ > int p; > int k; > unsigned int n; > > void x () > { >unsigned int h; >h = n <= 30; >if (h) > p = 1; >else > p = 0; > > if (h) > k = 1; > else > k = 0; >} > >unsigned int n = 30; > > main () > { > x (); > if (p != 1 || k != 1) > abort (); > exit (0); > } > > This bug was fixed previously. > 1. Can i get more information on how the bug was fixed? http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6997 > 2. what does sleu pattern mean? Set if Lessthan or Equal Unsigned. Andrew.
Xlib problems, only with GCC 4.1.0
Hi, I have a simple GUI application written with wxWidgetsGTK-2.6. Well, in practise there's one secondary thread that periodically updates a text control object: in terms of gtk api, it calls a gtk_text_buffer_insert, which, of course, doesn't request for an immediate repaint of the screen, but post an event for the main thread, the only one that really manages sreen update. Well, my program works correctly if compiled, for example, with gcc-3.3.5 (on SuSe and Debian) or gcc-3.4.3 (on Ubuntu). If compiled with gcc-4.1.0 (on the latest SuSe 10.1 release) (exactly the same code) the program crashes when calls the gtk_text_buffer_insert, with the error Xlib: unexpected asynch reply, which I know was a problem of old versions of Xlib with multithreading. Well, any idea, any knew optizimation features of gcc-4.1.0 that may cause a thing like that?? Of couse I recompile everithing with the gcc-4.1.0, also wxWidgets Please, help me if you can, thank you very much MARCO GUBERNATI MARCO GUBERNATI
Re: Abt SIMD Emulation
Mohamed Shafi <[EMAIL PROTECTED]> writes: This question is more appropriate for the gcc-help mailing list than for the gcc mailing list. > For targets which doesn't have simd hardware support like fr30 , simd stuff > is emulated? Yes, if you use __attribute__ ((vector_size (NN))) for a target which does not support vector registers of that size, gcc will emulate the vector handling. > Is there some flags/macros in gcc to indicate that? To indicate what? > How is it done in other targets which deosnt have the hardware support? In the obvious tedious way: as a loop over the elements. Ian
Re: Wiki, documenting Tree SSA passes
Basile STARYNKEVITCH <[EMAIL PROTECTED]> writes: > On the Wiki, http://gcc.gnu.org/wiki/MiddleEnd I am trying to document very > briefly the passes on Gimple SSA trees Thanks! > I cannot yet submit patches to it (file gcc/doc/passes.texi) yet, because my > copyright assignement form takes some time to be signed at CEA-LIST where I > am working on GCC (but I think it will be signed soon). Do I understand > correctly that no patch of more than 10 lines can be sent to gcc-patches@ > without the FSF having recieved the copyright transfer (or assignment) > paper? Yes. > Is documenting the passes on the Wiki worthwile? Yes. Ian
Re: Abt SIMD Emulation
For targets which doesn't have simd hardware support like fr30 , simd stuff is emulated? Is there some flags/macros in gcc to indicate that? To indicate what? I guess to indicate that the vector is emulated. The TYPE_MODE of the vector type, in that case, is BLKmode or an integer mode. How is it done in other targets which deosnt have the hardware support? In the obvious tedious way: as a loop over the elements. With the additional optimization that & | ^ ~ can be done word-by-word, + - can use bit-twiddling if there are at least 4 elements by word (otherwise it is not profitable), and that smaller SIMD instructions (e.g. 2 8-byte SIMD instructions to emulate a 16-byte vector) may be used if supported. See tree-ssa-vect-generic.c for the gory details. Paolo
Re: Xlib problems, only with GCC 4.1.0
On Fri, Oct 13, 2006 at 03:32:06PM +0200, Marco Gubernati wrote: > Well, my program works correctly if compiled, for example, with > gcc-3.3.5 (on SuSe and Debian) or gcc-3.4.3 (on Ubuntu). If compiled > with gcc-4.1.0 > (on the latest SuSe 10.1 release) (exactly the same code) the program > crashes when calls the gtk_text_buffer_insert, with the error Xlib: > unexpected asynch reply, which I know was > a problem of old versions of Xlib with multithreading. Well, any idea, > any knew optizimation features of gcc-4.1.0 that may cause a thing like > that?? While a compiler bug is possible, with these kinds of things other causes are more likely: undefined behavior (e.g. reading uninitialized memory) or an aliasing issue (gcc 4.x does more aggressive optimization based on the C language rules about which types can be addressed by which types of pointers). I'd suggest checking your program with a tool like valgrind (when compiled with a compiler that makes the program work) to make sure that there aren't things like uninitialized memory. You could also try the -fno-strict-aliasing flag of gcc 4.1.0, to see if that's an issue. You can then try to narrow down the bug (whether in your code, or the compiler) by compiling some object files with one compiler and some with another.
[PATCH] Relocated compiler should not look in $prefix.
A relocated compiler should not look in $prefix. A relocated compiler should never search the configured prefix for programs, libraries or start files. A relocated compiler searching for files in the configured prefix is troublesome. The configured prefix may contain a conflicting toolchain, or a slow network path. The old behaviour of searching the conifgured prefix is not what users expect from a relocated toolchain. Consider 3 types of paths: 1. Relocated paths. 2. Configured prefix paths. 3. Well known system paths. The type 1 and type 3 paths are always added to our search lists. The type 2 paths are only added if the compiler is installed at the configured prefix. This patch groups the 3 path types logically in gcc/gcc.c, and adds the paths based on the wether the compiler is relocated or unrelocated. The testing infrastructure also needs to be updated. Testing in the object directory often uses libraries or start files from the configured prefix. To enable testing from the object directory we export GCC_EXEC_PREFIX with the value of the configured prefix. This gives the old behaviour for the testsuite. Comments? OK for Stage1? Tested without regression on i686-pc-linux-gnu (All languages), arm-none-eabi, and arm-none-linux-gnueabi. This is the first, of two, step to fixing pr17621. Cheers, Carlos. -- Carlos O'Donell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x716 2006-10-13 Carlos O'Donell <[EMAIL PROTECTED]> Mark Mitchell <[EMAIL PROTECTED]> * gcc.c: Organize search path variables into $prefix relative, and well-known native. Add comments. (add_sysrooted_prefix): Add comment. (process_command): If !gcc_exec_prefix add $prefix based paths. If *cross_compile == '0', add native well-known paths. Assert tooldir_base_prefix is always relative. (main): If print_search_dirs, and if gcc_exec_prefix is set, use this value for 'install:' path. * Makefile.in: Add GCC_EXEC_PREFIX to generated site.exp. Index: gcc/gcc.c === --- gcc/gcc.c (revision 117699) +++ gcc/gcc.c (working copy) @@ -1472,26 +1472,34 @@ #define MD_STARTFILE_PREFIX_1 "" #endif +/* These directories are locations set at configure-time based on the + --prefix option provided to configure. Their initializers are + defined in Makefile.in. These paths are not *directly* used when + gcc_exec_prefix is set because, in that case, we know where the + compiler has been installed, and use paths relative to that + location instead. */ static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX; +static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX; +static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX; +static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; + +/* For native compilers, these are well-known paths containing + components that may be provided by the system. For cross + compilers, these paths are not used. */ static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/"; static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/"; static const char *md_exec_prefix = MD_EXEC_PREFIX; - static const char *md_startfile_prefix = MD_STARTFILE_PREFIX; static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1; -static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; -static const char *const standard_startfile_prefix_1 +static const char *const standard_startfile_prefix_1 = STANDARD_STARTFILE_PREFIX_1; static const char *const standard_startfile_prefix_2 = STANDARD_STARTFILE_PREFIX_2; +/* A relative path to be used in finding the location of tools + relative to the driver. */ static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX; -static const char *tooldir_prefix; -static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX; - -static const char *standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX; - /* Subdirectory to use for locating libraries. Set by set_multilib_dir based on the compilation options. */ @@ -2749,6 +2757,7 @@ } /* Same as add_prefix, but prepending target_system_root to prefix. */ +/* The target_system_root prefix has been relocated by gcc_exec_prefix. */ static void add_sysrooted_prefix (struct path_prefix *pprefix, const char *prefix, const char *component, @@ -3278,6 +3287,7 @@ int is_modify_target_name; unsigned int j; #endif + const char *tooldir_prefix; GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX"); @@ -3383,10 +3393,18 @@ gcc_libexec_prefix = make_relative_prefix (tmp_prefix, standard_exec_prefix, standard_libexec_prefix); + + /* The path is unrelocated, so fallback to the
Re: abt compiler flags
On Thu, Oct 12, 2006 at 10:44:59PM -0700, Mohamed Shafi wrote: > Hello all, > > During regression tests if i want to disable some features like trampolines i > can give -DNO_TRAMPOLINES > as an compiler flag. By default, -DNO_TRAMPOLINES is set in testsuite/lib/gcc.exp if the DejaGnu target info reports that the support doesn't exist. The only other feature treated this way is no_label_values. > Do i have similar flags for profiling and PIC? Not for the user to disable them, although tests for these features check whether the support is available to the target. The procs that check for the support are check_profiling_available and check_effective_target_fpic in testsuite/lib/target-supports.exp. The .exp files for profiling tests call check_profiling_available and skip the directory if that proc returns 0. "fpic" is an effective-target keyword that can be used alone or in combination with other target information to limit when a test is run, e.g. "{ dg-do run { target fpic } }". There's no way to disable tests for these features if the procs in target-supports.exp claim that they are supported. If your target doesn't support them, you can modify those procs to skip the tests. Janis
gcc.dg/cpp/_Pragma3.c seems broken...
With svn r117549 bootstrapped on mipsel-none-linux-gnu: The test gcc.dg/cpp/_Pragma3.c basically checks whether _Pragma3.c is not younger than the file mi1c.h in the same directory. The test fails with excess errors if this is not the case: . . . Executing on host: /home/build/gcc-build/gcc/xgcc -B/home/build/gcc-build/gcc/ /home/build/gcc/gcc/testsuite/gcc.dg/cpp/_Pragma3.c-ansi -pedantic-errors -fno-show-column -E -o _Pragma3.i(timeout = 300) /home/build/gcc/gcc/testsuite/gcc.dg/cpp/_Pragma3.c:11: warning: current file is older than mi1c.h output is: /home/build/gcc/gcc/testsuite/gcc.dg/cpp/_Pragma3.c:11: warning: current file is older than mi1c.h FAIL: gcc.dg/cpp/_Pragma3.c (test for excess errors) Excess errors: /home/build/gcc/gcc/testsuite/gcc.dg/cpp/_Pragma3.c:11: warning: current file is older than mi1c.h . . . After doing a svn checkout I have: $ ls --full-time _Pragma3.c mi1c.h -rw-r--r-- 1 root root 309 2006-10-06 23:51:13.0 -0700 _Pragma3.c -rw-r--r-- 1 root root 214 2006-10-06 23:51:14.0 -0700 mi1c.h Am I missing something here, or is the success of this test really based on the ability of svn to get both of these files within the same second? If so that seems bad. David Daney
Re: gcc.dg/cpp/_Pragma3.c seems broken...
> > With svn r117549 bootstrapped on mipsel-none-linux-gnu: Usually people us gcc_update in contrib to update their sources which fixes this problem by touching the files which need to be touched. Thanks, Andrew Pinski
Re: Including GMP/MPFR in GCC repository?
On Thu, 12 Oct 2006, DJ Delorie wrote: > > > Okay for stage1? > > Ok, assuming everyone agrees to those versions ;-) Great, thanks. I haven't heard anyone disagree with those versions, so unless someone objects before stage1 starts I'll use those. By the way, here is a more complete patch which adds the documentation updates I promised. It also eliminates $need_gmp and $(F95_LIBS) as followup cleanups. Tested on sparc-sun-solaris2.10 via "make" with C & fortran enabled. I'll do more extensive testing (full bootstrap, regtest and "make info") shortly. Ironically given the nature of this patch, configure is saying I need to get a more recent makeinfo in order to build the docs. :-) Thanks, --Kaveh 2006-10-13 Kaveh R. Ghazi <[EMAIL PROTECTED]> * configure.in: Require GMP-4.1+ and MPFR-2.2+. Don't check need_gmp anymore. * configure: Regenerate. gcc: * Makefile.in (LIBS): Add $(GMPLIBS). * doc/install.texi: Update GMP and MPFR requirements. * doc/sourcebuild.texi (need_gmp): Delete. gcc/fortran: * Make-lang.in (F95_LIBS): Delete. * f951$(exeext): Use $(LIBS) instead of $(F95_LIBS). * config-lang.in (need_gmp): Delete. diff -rup orig/egcc-SVN20061011/configure.in egcc-SVN20061011/configure.in --- orig/egcc-SVN20061011/configure.in 2006-09-27 20:01:59.0 -0400 +++ egcc-SVN20061011/configure.in 2006-10-13 03:05:01.309928436 -0400 @@ -1103,24 +1103,24 @@ choke me ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) if test x"$have_gmp" = xyes; then + saved_LIBS="$LIBS" + LIBS="$LIBS $gmplibs" AC_MSG_CHECKING([for correct version of mpfr.h]) - AC_TRY_COMPILE([#include "gmp.h" + AC_TRY_LINK([#include #include ],[ #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2) choke me #endif -], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy version of MPFR detected])]) - - saved_LIBS="$LIBS" - LIBS="$LIBS $gmplibs" - AC_MSG_CHECKING([for any version of mpfr.h]) - AC_TRY_LINK([#include -#include ], [mpfr_t n; mpfr_init(n);], -[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) + mpfr_t n; mpfr_init(n); +], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no]) LIBS="$saved_LIBS" fi CFLAGS="$saved_CFLAGS" +if test x$have_gmp != xyes; then + AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.2+. Try the --with-gmp and/or --with-mpfr options.]) +fi + # Flags needed for both GMP and/or MPFR AC_SUBST(gmplibs) AC_SUBST(gmpinc) @@ -1208,7 +1208,6 @@ if test -d ${srcdir}/gcc; then subdir_requires= boot_language= build_by_default= -need_gmp= . ${lang_frag} potential_languages="${potential_languages},${language}" # This is quite sensitive to the ordering of the case statement arms. @@ -1254,18 +1253,6 @@ if test -d ${srcdir}/gcc; then esac done -# Disable languages that need GMP if it isn't available. -case ,${enable_languages},:${have_gmp}:${need_gmp} in - *,${language},*:no:yes) -# Specifically requested language; tell them. -AC_MSG_ERROR([GMP 4.1 and MPFR 2.2 or newer versions required by $language]) -;; - *:no:yes) -# Silently disable. -add_this_lang=no -;; -esac - # Disable a language that is unsupported by the target. case " $unsupported_languages " in *" $language "*) diff -rup orig/egcc-SVN20061011/gcc/Makefile.in egcc-SVN20061011/gcc/Makefile.in --- orig/egcc-SVN20061011/gcc/Makefile.in 2006-10-10 20:01:28.0 -0400 +++ egcc-SVN20061011/gcc/Makefile.in2006-10-13 03:00:25.192043515 -0400 @@ -846,7 +846,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) # How to link with both our special library facilities # and the system's installed libraries. -LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) +LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) $(GMPLIBS) # Any system libraries needed just for GNAT. SYSLIBS = @GNAT_LIBEXC@ diff -rup orig/egcc-SVN20061011/gcc/doc/install.texi egcc-SVN20061011/gcc/doc/install.texi --- orig/egcc-SVN20061011/gcc/doc/install.texi 2006-10-03 20:00:51.0 -0400 +++ egcc-SVN20061011/gcc/doc/install.texi 2006-10-13 03:03:49.824512100 -0400 @@ -292,13 +292,13 @@ systems' @command{tar} programs will als @item GNU Multiple Precision Library (GMP) version 4.1 (or later) -Necessary to build the Fortran frontend. If you do not have it -installed in your library search path, you will have to configure with -the @option{--with-gmp} or @option{--with-gmp-dir} configure option. +Necessary to build GCC. If you do not have it installed in your +library search path, you will have to configure with the [EMAIL PROTECTED] or @option{--with-gmp-dir} configure option. @item MPFR Library v
FW: How does GCC implement dynamic binding?
Hello, We are using GCC 3.3.1 and have a requirement imposed upon us by our customer to "...establish that the C++ compiler implements dynamic binding by utilizing static lookup tables..." This implies the need for documentation on GCC's implementation of dynamic binding, which is typically achieved in "most compilers" through static vtables. At the GCC site (http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Vague-Linkage.html#Vague-Li nkage), the manual for our compiler states: === Vtables C++ virtual functions are implemented in most compilers using a lookup table, known as a vtable. The vtable contains pointers to the virtual functions provided by a class, and each object of the class contains a pointer to its vtable (or vtables, in some multiple-inheritance situations). If the class declares any non-inline, non-pure virtual functions, the first one is chosen as the "key method" for the class, and the vtable is only emitted in the translation unit where the key method is defined. Note: If the chosen key method is later defined as inline, the vtable will still be emitted in every translation unit which defines it. Make sure that any inline virtuals are declared inline in the class body, even if they are not defined there. === The best we have here is an inference that the 3.3.1 compiler uses lookup tables (note the term "most compilers"), and no indication at all re whether they are static in size and content. The C++ FAQ site (http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.4) implies that "most C++ compilers" use a scheme similar to the one presented on that page, i.e., that the v-tables are created at compile time, and are static in size and content. The only run-time (dynamic) aspect is the initialization of the v-pointer in the class constructor. Given all this, I posed this question to the gcc mailing list and received a reply that directed me to the C++ ABI (http://codesourcery.com/cxx-abi/), which is more detailed and has the information I'm looking for. However, I need to confirm, in the case of an FAA audit, that GCC 3.3.1 implements dynamic binding in this fashion. Can anyone on the steering committee "officially" confirm that GCC uses static v-tables as described in the ABI? Thank you for your time. I look forward to your response. Regards, Greg Lacefield Principal Software Engineer Honeywell CommNav Engineering Aerospace -- Redmond 15001 NE 36th Street, M/S B13E Redmond, Washington 98052 (425) 376-2353 office (425) 647-5281 mobile (425) 885-8319 fax mailto:[EMAIL PROTECTED]
Re: GNAT, SJLJ and zero-cost exception handling
> I'd like to know how I should go about building GCC such that I can choose > between SJLJ and ZCX at compile time, using --rts=sjlj. $srcdir/configure --enable-languages=ada --disable-libada make [bootstrap] make -C gcc gnatlib-sjlj make install in the $prefix/lib/gcc/$target/$version directory: - create 'sjlj' subdir - move 'adainclude' and 'adalib' subdirs to 'sjlj' subdir rm gcc/stamp-gnatlib* make -C gcc gnatlib-shared gnattools make install You need GCC 3.x or GCC 4.2 for GNAT SJLJ exceptions to work. > From [2] it looks like this is a configure-time option only. [2] describes GCC SJLJ, which is not the same as GNAT SJLJ. -- Eric Botcazou
Re: FW: How does GCC implement dynamic binding?
Given all this, I posed this question to the gcc mailing list and received a reply that directed me to the C++ ABI (http://codesourcery.com/cxx-abi/), which is more detailed and has the information I'm looking for. However, I need to confirm, in the case of an FAA audit, that GCC 3.3.1 implements dynamic binding in this fashion. Can anyone on the steering committee "officially" confirm that GCC uses static v-tables as described in the ABI? The steering committee doesn't do this type of thing. It follows the ABI, and uses static lookup tables. If you want confirmation, you are free to look at the source code. There is no legal entity that is going to give you some "official" confirmation of some sort. Sorry, Dan
gcc-4.1-20061013 is now available
Snapshot gcc-4.1-20061013 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.1-20061013/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.1 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch revision 117714 You'll find: gcc-4.1-20061013.tar.bz2 Complete GCC (includes all of below) gcc-core-4.1-20061013.tar.bz2 C front end and core compiler gcc-ada-4.1-20061013.tar.bz2 Ada front end and runtime gcc-fortran-4.1-20061013.tar.bz2 Fortran front end and runtime gcc-g++-4.1-20061013.tar.bz2 C++ front end and runtime gcc-java-4.1-20061013.tar.bz2 Java front end and runtime gcc-objc-4.1-20061013.tar.bz2 Objective-C front end and runtime gcc-testsuite-4.1-20061013.tar.bz2The GCC testsuite Diffs from 4.1-20061006 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-4.1 link is updated and a message is sent to the gcc list. Please do not use a snapshot before it has been announced that way.
Re: FW: How does GCC implement dynamic binding?
On Fri, Oct 13, 2006 at 03:24:08PM -0500, Lacefield, Greg (CNS COE) wrote: > However, I need to confirm, in the case of > an FAA audit, that GCC 3.3.1 implements dynamic binding in this fashion. > Can anyone on the steering committee "officially" confirm that GCC uses > static v-tables as described in the ABI? This would imply that you are asking for some kind of indemnification or binding promise. GCC comes with no warranties of any kind. I can informally and unofficially tell you that GCC uses conventional static virtual function tables and *attempts* to comply with the ABI; I can also tell you that 3.3.x had some bugs in ABI conformance that were fixed in 3.4, so the compliance is not perfect. Also, 3.3.1 is an odd release to choose if you are worrying about quality; four bug fix releases were made to the gcc 3.3.x series after that (the last one was 3.3.5); none of these addressed the ABI problem because of the GCC project's rules for binary compatibility between x.y.z and x.y.(z+1) (again, no warranty on this, but the aim is not to break compatibility). See http://gcc.gnu.org/releases.html for the full history. One possibility is for you to hire a consultant to determine whether the version of gcc that you are using meets your customer's requirements, or assign a staff member to do this job.
Re: FW: How does GCC implement dynamic binding?
Lacefield, Greg (CNS COE) wrote: We are using GCC 3.3.1 and have a requirement imposed upon us by our customer to "...establish that the C++ compiler implements dynamic binding by utilizing static lookup tables..." The short answer is "yes, GCC uses static lookup tables for dynamic binding". But don't take that as anything more than an educated opinion, and certainly not certification. Given all this, I posed this question to the gcc mailing list and received a reply that directed me to the C++ ABI (http://codesourcery.com/cxx-abi/), which is more detailed and has the information I'm looking for. However, I need to confirm, in the case of an FAA audit, that GCC 3.3.1 implements dynamic binding in this fashion. Can anyone on the steering committee "officially" confirm that GCC uses static v-tables as described in the ABI? You should read the GPL license (http://www.gnu.org/copyleft/gpl.html) under which GCC is distributed. In particular see Paragraph 11, under the large heading "NO WARRANTY". I question whether you will find anyone who would be willing to affirm that GCC has any specific behavior if such a certification were intended to provide a guarantee or warranty, or if there was any expectation that there was any assumption of liability for GCC's failure to perform as indicated. -- Michael Eager[EMAIL PROTECTED] 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
Re: building gcc
On Thu, Oct 12, 2006 at 07:45:52AM -0700, Ian Lance Taylor wrote: > Bob Rossi <[EMAIL PROTECTED]> writes: > > > Hopefully I'll be able to debug gcc nicely after this is built. Two > > more questions that could save me a lot of time. Do you know where the > > abstract syntax tree is stored in GCC after a file is parsed? > > I'm not sure what kind of answer you are looking for. One place to > look is in the cgraph code. > > > Does GCC > > still create an AST for C/C++, or does it go directly to GIMPLE? > > gcc generates an AST, of sorts, for C++. For C it goes directly to > GIMPLE (really GENERIC, but they are pretty similar). Hi Ian, Basically, I want to use GCC with C,C++. I want to walk a tree that GCC creates for the translation units. I would like to know if for these two languages if I should use a language dependent tree, the generic tree or the gimple tree. In general, I would like to use the tree that most closely resembles the source language, and that is documented best. For starters, can you recommend which tree structure I should use in GCC? If so, would it be to much to ask to point me to the object in the source code that represents the tree after the tree has been populated? If I should be using gimple, I found this paper. ftp://gcc.gnu.org/pub/gcc/summit/2003/GENERIC%20and%20GIMPLE.pdf Is there any other good documentation on this? Thanks, Bob Rossi
Re: FW: How does GCC implement dynamic binding?
Michael Eager wrote: Lacefield, Greg (CNS COE) wrote: Given all this, I posed this question to the gcc mailing list and received a reply that directed me to the C++ ABI (http://codesourcery.com/cxx-abi/), which is more detailed and has the information I'm looking for. However, I need to confirm, in the case of an FAA audit, that GCC 3.3.1 implements dynamic binding in this fashion. Can anyone on the steering committee "officially" confirm that GCC uses static v-tables as described in the ABI? You should read the GPL license (http://www.gnu.org/copyleft/gpl.html) under which GCC is distributed. In particular see Paragraph 11, under the large heading "NO WARRANTY". I question whether you will find anyone who would be willing to affirm that GCC has any specific behavior if such a certification were intended to provide a guarantee or warranty, or if there was any expectation that there was any assumption of liability for GCC's failure to perform as indicated. Perhaps you are right, but it would not surprise me if there were commercial entities based around FOSS that would provide that type of support. David Daney
Re: building gcc
Bob Rossi wrote: > Hi Ian, > > Basically, I want to use GCC with C,C++. I want to walk a tree that GCC > creates for the translation units. I would like to know if for these two > languages if I should use a language dependent tree, the generic tree or > the gimple tree. In general, I would like to use the tree that most closely > resembles the source language, and that is documented best. > > For starters, can you recommend which tree structure I should use in > GCC? If so, would it be to much to ask to point me to the object in the > source code that represents the tree after the tree has been populated? > > If I should be using gimple, I found this paper. > ftp://gcc.gnu.org/pub/gcc/summit/2003/GENERIC%20and%20GIMPLE.pdf > Is there any other good documentation on this? I cant help much as i have only been fumbling around in the GCC source for a short time now and still have no idea about a lot of stuff. However I did want to also look at the full tree for the C++ front end. I did this from the parser.c: cp_parser_translation_unit() function just after the call to: finish_translation_unit() and I was looking at the tree defined globally elsewhere in the variable: global_namespace This is probably not the best spot to look at the tree but it seemed to work for me. However i have recently been changing the way i do things as working with the full tree was VERY in-efficient for my task. I now look at the trees for individual functions as they pass through: gimplify.c: gimplify_function_tree() It sped my code up by over 100x. I guess it really depends on what you wish to do and I am sure someone else on this list can help a lot more than i can. Brendon.
Re: Abt SIMD Emulation
First thanks for the reply. I want to know what can be done in the back end of a target to indicate that SIMD stuff should be emulated all the way. __attribute__ ((vector_size (NN))) is something that can be done in programs. Is there any target macros or hooks available for that. Will the target hook TARGET_VECTOR_MODE_SUPPORTED_P hep me to indicate that? Guess this is the right mailing list for my question. Thanks in advance. Regards, Shafi. - Original Message From: Ian Lance Taylor <[EMAIL PROTECTED]> To: Mohamed Shafi <[EMAIL PROTECTED]> Cc: gcc@gcc.gnu.org Sent: Friday, October 13, 2006 8:01:11 PM Subject: Re: Abt SIMD Emulation Mohamed Shafi <[EMAIL PROTECTED]> writes: This question is more appropriate for the gcc-help mailing list than for the gcc mailing list. > For targets which doesn't have simd hardware support like fr30 , simd stuff > is emulated? Yes, if you use __attribute__ ((vector_size (NN))) for a target which does not support vector registers of that size, gcc will emulate the vector handling. > Is there some flags/macros in gcc to indicate that? To indicate what? > How is it done in other targets which deosnt have the hardware support? In the obvious tedious way: as a loop over the elements. Ian