A question concering GCC testsuite
Hello, I appreciate it if someone could explain what is the difference between gcc.c-torture library and gcc.dg library under the testsuite directory. Thanks, Revital
Re: A question concering GCC testsuite
On Thu, 2006-10-05 at 09:27 +0200, Revital1 Eres wrote: > Hello, > > I appreciate it if someone could explain what is the difference between > gcc.c-torture library and gcc.dg library under the testsuite directory. http://gcc.gnu.org/wiki/HowToPrepareATestcase Should explain it. If it does not, here is the best explaination I can come up with: gcc.dg (except for gcc.dg/torture) is for testing only one optimization level gcc.c-torture is for testing multiple optimization levels and don't have a lot of the features that gcc.dg can do like dg-final (maybe this has changed already but I forgot). I think the main reason why there are still two directories is just historical and nobody really wants to move around 100 and change or so testcases to be included in gcc.dg/torture. Thanks, Andrew Pinski
Get C/C++ Preprocessor Tokens
Hi, I need to get the C/C++ Preprocessor tokens for perform some operations on them. How can I write a program interface the Preprocessor and get the token that it analyze? Tnaks for help. Matteo. __ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it
Get C/C++ Preprocessor Tokens
Hi Matteo, Do you want the list of tokens present in the source file which is being compiled ? - Regards, Raghavendra MB. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matteo Fioroni Sent: Thursday, October 05, 2006 1:26 PM To: gcc@gcc.gnu.org Subject: Get C/C++ Preprocessor Tokens Hi, I need to get the C/C++ Preprocessor tokens for perform some operations on them. How can I write a program interface the Preprocessor and get the token that it analyze? Tnaks for help. Matteo. __ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it
Re: Documentation for loop infrastructure
Zdenek Dvorak <[EMAIL PROTECTED]> wrote on 28/09/2006 15:04:07: > > I have commited the documentation, including the parts from Daniel and > Sebastian (but not yours) now. > > Zdenek I've committed my part. Ira
Re: [MIPS64] Problems when Passing TImode Parameters in EABI
"Fu, Chao-Ying" <[EMAIL PROTECTED]> writes: > I think there is a bug in mips_pass_by_reference when the mips abi > is EABI to pass TImode parameters. Good catch. > Does someone know how to pass TImode parameters in EABI? Thanks! I imagine this case wasn't specifically considered. The EABI calls for double-word integers to be passed by value on 32-bit targets, so if 128-bit integers had been considered, I imagine the EABI would call for them to be handled in the same way on 64-bit targets. As it is, the EABI uses stack passing as the fallback case for "parameters not otherwise handled above". So I think the type != NULL case is doing the right thing. Sticking with it also has the advantage that it wouldn't break backward compatiblity for cases that currently work. I don't think this particular case has ever worked for libcalls. I'll whip up a patch tonight. I imagine this is also the reason for the gcc.dg/torture/fp-int-convert-timode.c failures on mipsisa64-elf, which I haven't had the spare time to look at yet. Richard
Re: [MIPS64] Problems when Passing TImode Parameters in EABI
Fu, Chao-Ying wrote: > Hello, > > I think there is a bug in mips_pass_by_reference when the mips abi > is EABI to pass TImode parameters. > > > The following code is from the mainline GCC "mips.c". > - > mips_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, > enum machine_mode mode, tree type, > bool named ATTRIBUTE_UNUSED) > { > if (mips_abi == ABI_EABI) > { > int size; > > /* ??? How should SCmode be handled? */ > if (type == NULL_TREE || mode == DImode || mode == DFmode) > return 0; > > size = int_size_in_bytes (type); > return size == -1 || size > UNITS_PER_WORD; > } > else > { > /* If we have a variable-sized parameter, we have no choice. */ > return targetm.calls.must_pass_in_stack (mode, type); > } > } > - > When "type" is NULL_TREE, this function returns "0". But when "type" is > not NULL and > the size of TImode is bigger than UNITS_PER_WORD, so it returns "1". > This causes inconsistency in the following test. > > # cat timode.c > typedef int TItype __attribute__ ((mode (TI))); > TItype test1 (TItype a) > { > return a*a; > } > > # mipsisa64-elf-gcc -S timode.c -O3 > > ### timiode.s > test1: > daddiu $sp,$sp,-8 > sd $31,0($sp) > ld $3,8($4) <- Parameter in stack > ld $2,0($4) <- Parameter in stack > move$7,$3 < Parameter in register > move$4,$2 < Parameter in register > move$5,$3 < Parameter in register > jal __multi3 > move$6,$2 < Parameter in register > > ld $31,0($sp) > move$4,$2 > move$2,$4 > j $31 > daddiu $sp,$sp,8 > > Does someone know how to pass TImode parameters in EABI? Thanks! > Hi Chao-ying MIPS ABIs do not usually document the behaviour of 128 bit scalars, since such types are not defined by most language standards, and are typically only available via compiler-specific extensions. So if TImode arguments work correctly on any ABI, then I would guess that it might be more by luck than design! EABI is one of the more sketchily specified MIPS ABIs -- the 64-bit variant probably even more so. You could fix the mips.c back-end to handle TImode consistently for EABI and post those changes to the appropriate list for comment. But I wonder if you really need to use EABI, or are only using it because it's the default for a mipsisa64-elf configuration. If the latter is true, then you could try using the N32 ABI and see if that works better for you (i.e. use the --with-abi=n32 argument when configuring your toolchain). FWIW our own gcc-3.4 mips-sde-elf configurations default to using N32 for 64-bit ISAs, though we've not yet tested that on gcc-4. Nigel
Re: How can I interface myself with the C preprocessor?
Matteo Fioroni wrote: Thanks for your help, I saw the gcc -E output: but it don't match my needs. I've to interface the Preprocessor to get the tokens (keyword, preprocessor directives, grammar, ecc..) it analyzes on which I've to permorm some operations. The preprocessor doesn't break C into the tokens you describe. Basically, all it knows about are preprocessor directives (starting with #), words, and other characters. The preprocessor doesn't know anything about keywords or the grammar. I think you have fallen (and we with you) into the trap of your telling us about how you want to solve some problem, without telling us what the problem is. So every solution is going to get the response "thanks, but that is what I need". If you want help with a problem, describe the problem. -- Michael Eager[EMAIL PROTECTED] 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
Re: How can I interface myself with the C preprocessor?
Michael Eager wrote: Matteo Fioroni wrote: Thanks for your help, I saw the gcc -E output: but it don't match my needs. I've to interface the Preprocessor to get the tokens (keyword, preprocessor directives, grammar, ecc..) it analyzes on which I've to permorm some operations. The preprocessor doesn't break C into the tokens you describe. Basically, all it knows about are preprocessor directives (starting with #), words, and other characters. The preprocessor doesn't know anything about keywords or the grammar. I think you have fallen (and we with you) into the trap of your telling us about how you want to solve some problem, without telling us what the problem is. So every solution is going to get the response "thanks, but that is what ^ not I need". If you want help with a problem, describe the problem. -- Michael Eager[EMAIL PROTECTED] 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
setjmp-3/setjmp-4 Darwin failures
Are the failures in the new setjmp-3 and setjmp-4 testcases on Darwin just another manifestation of PR10901? Jack
Re: IPA branch
Mark Mitchell <[EMAIL PROTECTED]> wrote on 29/09/2006 01:55:24: > Razya Ladelsky wrote: > > > Except for new optimizations, IPCP (currently on mainline) should also be > > transformed to SSA. > > IPCP in SSA code exists on IPA branch, and will be submitted to GCC4.3 > > after IPA branch > > is committed and some testsuite regressions failing with > > IPCP+versioning+inlining are fixed. > > Is there a project page for this work? > Mark, I integrated SSA IPCP as part of IPA branch page, as it seems the most natural place. IPCP code and also versioning code (used by IPCP and by the inliner) have to be translated into SSA, and so there's a big correlation among the parts. http://gcc.gnu.org/wiki/ipa-branch Thanks, Razya > Thanks, > > -- > Mark Mitchell > CodeSourcery > [EMAIL PROTECTED] > (650) 331-3385 x713
How do I code and compile a class liberary?
Dear Sirs, I've successfully compiled a complete application into an executable using g++. I'm trying to develop a class library and compile into library for use by other programs. Can any one show me how? Thank you very much in advance. C.-J. Mei
Re: How do I code and compile a class liberary?
On Oct 5, 2006, at 11:55 AM, Changjiang Mei wrote: I've successfully compiled a complete application into an executable using g++. I'm trying to develop a class library and compile into library for use by other programs. Can any one show me how? Thank you very much in advance. Please don't send to both lists. The gcc list isn't for such questions.
problems with labels
Hi, I'm trying to adjust an already existing target port of gcc-2.95.2 to gcc-4.1.0 and I came to a point where I could use some help. Everything seams fine until xgcc tries to compile libgcc2.c, then I get the following error messages: libgcc2.s: Assembler messages: libgcc2.s:52: Error: unknown pseudo-op: `.lm_0' libgcc2.s:61: Error: unknown pseudo-op: `.lm_1' libgcc2.s:83: Error: unknown pseudo-op: `.lm_2' libgcc2.s:89: Error: unknown pseudo-op: `.lm_3' libgcc2.s:95: Error: unknown pseudo-op: `.lm_4' libgcc2.s:98: Error: unknown pseudo-op: `.lm_5' libgcc2.s:103: Error: unknown pseudo-op: `.lm_6' libgcc2.s:115: Error: unknown pseudo-op: `.lm_7' libgcc2.s:121: Error: unknown pseudo-op: `.lm_8' libgcc2.s:127: Error: unknown pseudo-op: `.lm_9' libgcc2.s:133: Error: unknown pseudo-op: `.lm_10' libgcc2.s:139: Error: unknown pseudo-op: `.lm_11' I have looked into the assembler file, and found out that those are actually labels which are missing ":" at the end and that the labels are redundant. Here is the part of the file: .global ___muldi3 ___muldi3: .stabd 46,0,0 .stabd 68,0,511 .LM_0 .LM_0: #BEGIN PROLOGUE frame L14, L4 #END PROLOGUE .LBB_2: .LBB_3: .stabd 68,0,514 .LM_1 .LM_1: mov L8 , L1 mov L7 , L3 shri L8 , 16 I have found out that the correct labels are written out by the hook TARGET_ASM_INTERNAL_LABEL and the faulty ones are the result of the output from the macro ASM_GENERATE_INTERNAL_LABEL, but I cannot figure out why the latter ones gets written out at all. Best regards Andrija
Re: problems with labels
On Oct 5, 2006, at 1:56 PM, Andrija Radicevic wrote: libgcc2.s:52: Error: unknown pseudo-op: `.lm_0' .LM_0 .LM_0: I have found out that the correct labels are written out by the hook TARGET_ASM_INTERNAL_LABEL and the faulty ones are the result of the output from the macro ASM_GENERATE_INTERNAL_LABEL, Does your generate look substantially different from: #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)) Hint, I put it outputs a label, which is wrong (or calls something that does).
Re: problems with labels
Does your generate look substantially different from: #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)) Hint, I put it outputs a label, which is wrong (or calls something that does). no, it's simple like yours #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)\ sprintf (LABEL, "*%s%s_%lu", \ (TARGET_GNU_ASM)?".":"", PREFIX, (unsigned long) NUM)
gcc-4.0-20061005 is now available
Snapshot gcc-4.0-20061005 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.0-20061005/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.0 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_0-branch revision 117468 You'll find: gcc-4.0-20061005.tar.bz2 Complete GCC (includes all of below) gcc-core-4.0-20061005.tar.bz2 C front end and core compiler gcc-ada-4.0-20061005.tar.bz2 Ada front end and runtime gcc-fortran-4.0-20061005.tar.bz2 Fortran front end and runtime gcc-g++-4.0-20061005.tar.bz2 C++ front end and runtime gcc-java-4.0-20061005.tar.bz2 Java front end and runtime gcc-objc-4.0-20061005.tar.bz2 Objective-C front end and runtime gcc-testsuite-4.0-20061005.tar.bz2The GCC testsuite Diffs from 4.0-20060928 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-4.0 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.
Creating a VAR_DECL in a named section.
Hi all, I have been trying to place some data into a named section of a .o file. I can do it currently by hooking into various of the RTL to assembly routines and emitting the asm code directly, however I am now trying to do it from within the C++ front end by inserting a VAR_DECL node and setting it as belonging into a named section. I have some code that looks like: void bjc_add_var_decl(tree node) { tree identifier; tree section_name; tree var_decl; tree var_decl_type; size_t data_len; const char* data = "Some data to save to the named section."; const char* id_name = "BJC_SOME_ID"; tree init; identifier = get_identifier(id_name); data_len = strlen(data); var_decl_type = build_array_type(char_type_node, build_index_type(size_int(data_len))); var_decl_type = c_build_qualified_type(var_decl_type, TYPE_QUAL_CONST); var_decl = build_decl(VAR_DECL, identifier, var_decl_type); TREE_STATIC(var_decl) = 1; TREE_READONLY(var_decl) = 1; DECL_ARTIFICIAL(var_decl) = 1; init = build_string(data_len + 1, data); TREE_TYPE(init) = var_decl_type; DECL_INITIAL(var_decl) = init; TREE_USED(var_decl) = 1; section_name = build_string(strlen(".edoc"), ".edoc"); DECL_SECTION_NAME(var_decl) = section_name; LogFine("Need to attach it somewhere in the tree."); bind(identifier, var_decl, node, false, false); finish_decl(var_decl, init, NULL_TREE); pushdecl(var_decl); } I initially had it without the pushdecl() call and thought that the bind call would bind the new var_decl to the node passed into the function. I got most of the code above from looking at a few different places. One was some documentation for GEM, and another was from the code used in creating var decls for the nodes created when encountering __FUNCTION__ in the source. I have tried calling this method using a few different nodes, one was the global namespace node of type NAMESPACE_DECL just after finish_translation_unit() (I think that was the entry point), and another just after a call to finish function with the FUNCTION_DECL node. In all situations there has been nothing emitted in the resulting assembly source code. Up until now my hacking of GCC has only been reading values from the tree. I have not tried generating nodes and inserting them into the tree so this is really a first for me. Any ideas what I am doing wrong? Thanks for any help. Brendon.
Re: How can I interface myself with the C preprocessor?
Michael Eager wrote: Matteo Fioroni wrote: Thanks for your help, I saw the gcc -E output: but it don't match my needs. I've to interface the Preprocessor to get the tokens (keyword, preprocessor directives, grammar, ecc..) it analyzes on which I've to permorm some operations. The preprocessor doesn't break C into the tokens you describe. Basically, all it knows about are preprocessor directives (starting with #), words, and other characters. The preprocessor doesn't know anything about keywords or the grammar. The preprocessor had better know about preprocessing tokens, and it does. It doesn't know about keywords though (unless you consider conversion from preprocessing tokens to tokens to be the final stage of proprocessing). It's true that it doesn't know about most of the grammar. I think you have fallen (and we with you) into the trap of your telling us about how you want to solve some problem, without telling us what the problem is. So every solution is going to get the response "thanks, but that is what I need". Possibly. It's also very likely that the question is not topical here, as it doesn't appear to be about development of GCC. -- James