C Parser

2007-01-18 Thread Paulo J. Matos
Hi all, I was quite surprised to see that the C Parser was manually implemented and you didn't use any parser generator. I would be curious regarding this decision. I would think the development of a C parser would be an almost unsurmountable task and not very logic given the parser generators i

Where the languages meet...

2007-01-18 Thread Paulo J. Matos
Hello all, After reading the internals of gcc wikibooks some questions come up. So, gcc has front end for C, C++, java, fortran, etc.. All these languages have a frontend which parse into AST and then GIMPLE which is converted to RTX and then assembly. Now, my guess is that GIMPLE is the _common_

Dumping gimple tree

2007-01-18 Thread Paulo J. Matos
Hello, from "GENERIC and GIMPLE: A New Tree Representation for Entire Functions" by Jason Merrill it says there's a flag -fdump-tree-simple to get the gimple tree (page 3). However, this doesn't exist in gcc 4.1: $ gcc -fdump-tree-simple bigger3.c cc1: error: unrecognized command line option "-fdu

Re: Dumping gimple tree

2007-01-18 Thread Paulo J. Matos
Argh, forget it! Found the answer in: http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Debugging-Options.html#Debugging-Options Regards, Paulo Matos On 1/18/07, Paulo J. Matos <[EMAIL PROTECTED]> wrote: Hello, from "GENERIC and GIMPLE: A New Tree Representation for Entire Function

Re: Where the languages meet...

2007-01-18 Thread Paulo J. Matos
On 18 Jan 2007 07:42:38 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: "Paulo J. Matos" <[EMAIL PROTECTED]> writes: > After reading the internals of gcc wikibooks some questions come up. > So, gcc has front end for C, C++, java, fortran, etc.. > All these

Which optimization levels affect gimple?

2007-01-24 Thread Paulo J. Matos
Hi all, Which optimization levels affect gimple? I've tried for a program to check what kind of gimple code you get with -fdump-tree-gimple and -O0 and -O3 have different results, however, -O3 and -O9 have exactly the same output. Will -Ox for x > 3, generate the same gimple trees? (i.e., are don

Re: Which optimization levels affect gimple?

2007-01-26 Thread Paulo J. Matos
On 1/24/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 01/24/07 12:44: > check what kind of gimple code you get with -fdump-tree-gimple and > -O0 and -O3 have different results, > -fdump-tree-gimple is the first dump *before* any optimizations occur. To se

Re: Which optimization levels affect gimple?

2007-01-28 Thread Paulo J. Matos
On 24 Jan 2007 09:56:55 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: "Paulo J. Matos" <[EMAIL PROTECTED]> writes: > Which optimization levels affect gimple? > I've tried for a program to check what kind of gimple code you get > with -fdump-tree-g

Re: Which optimization levels affect gimple?

2007-01-28 Thread Paulo J. Matos
On 1/24/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 01/24/07 12:44: > check what kind of gimple code you get with -fdump-tree-gimple and > -O0 and -O3 have different results, > -fdump-tree-gimple is the first dump *before* any optimizations occur. To se

Re: Which optimization levels affect gimple?

2007-01-28 Thread Paulo J. Matos
On 1/26/07, Richard Guenther <[EMAIL PROTECTED]> wrote: On 1/26/07, Diego Novillo <[EMAIL PROTECTED]> wrote: > Paulo J. Matos wrote on 01/26/07 06:52: > > > Is the output of -fdump-tree-optimized a subset of GIMPLE? > > > Yes. The output is an incomplete tex

Re: Which optimization levels affect gimple?

2007-01-28 Thread Paulo J. Matos
On 1/28/07, Paulo J. Matos <[EMAIL PROTECTED]> wrote: On 1/24/07, Diego Novillo <[EMAIL PROTECTED]> wrote: > Paulo J. Matos wrote on 01/24/07 12:44: > > > check what kind of gimple code you get with -fdump-tree-gimple and > > -O0 and -O3 have different results, &

Re: Which optimization levels affect gimple?

2007-01-28 Thread Paulo J. Matos
On 1/26/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Richard Guenther wrote on 01/26/07 07:28: > It's after doing TER, so the statements are no longer valid GIMPLE statements. > Silly me. Richard's right. You want the output of -fdump-tree-uncprop. That's the last GIMPLE dump (if my memory d

Re: Which optimization levels affect gimple?

2007-01-29 Thread Paulo J. Matos
On 1/29/07, Diego Novillo <[EMAIL PROTECTED]> wrote: -fdump-tree-all gives you all the dumps by the high-level optimizers. -fdump-all-all gives you all the dumps by both GIMPLE and RTL optimizers. Is this -fdump-all-all version specific? Doesn't work on 4.1.1: $ g++ -fdump-all-all allocation.c

After GIMPLE...

2007-01-29 Thread Paulo J. Matos
Hi all, I've been looking into the gcc sources and I'm somewhat confused. Are gcc/g++ comepletely independent programs or do they share a backend? This question comes from the fact that I was trying to find a point in the source where I could get the GIMPLE tree and do with it what ever I wished

Re: Which optimization levels affect gimple?

2007-01-30 Thread Paulo J. Matos
On 1/29/07, Daniel Berlin <[EMAIL PROTECTED]> wrote: -fdump-tree-all-all will work as will -fdump-rtl-all-all I never added support for -fdump-all-all-all :) Thank you! -- Paulo Jorge Matos - pocm at soton.ac.uk http://www.personal.soton.ac.uk/pocm PhD Student @ ECS University of Southampto

Re: After GIMPLE...

2007-01-30 Thread Paulo J. Matos
On 29 Jan 2007 11:38:15 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: "Paulo J. Matos" <[EMAIL PROTECTED]> writes: > I've been looking into the gcc sources and I'm somewhat confused. > Are gcc/g++ comepletely independent programs or do they share a ba

Re: After GIMPLE...

2007-01-30 Thread Paulo J. Matos
On 29 Jan 2007 11:38:15 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: I don't see why you would have to modify any code in the frontend. You would modify the middle-end code. Rebuilding the compiler would rebuild cc1, cc1plus, etc. Well, I spent the morning looking at the code and since

Re: After GIMPLE...

2007-01-31 Thread Paulo J. Matos
On 1/31/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 01/30/07 10:11: > Well, I spent the morning looking at the code and since what I need is > only the flow of gcc up until I have the GIMPLE tree, I could add a > pass after the pass which generates the

Fwd: Compiling GCC

2007-02-01 Thread Paulo J. Matos
I forgot to send to the mailing list that the --disable-multilib from Andrew worked. Thank you all. :) -- Forwarded message -- From: Paulo J. Matos <[EMAIL PROTECTED]> Date: Jan 31, 2007 3:41 PM Subject: Re: Compiling GCC To: Andrew Haley <[EMAIL PROTECTED]> On 1/3

Re: After GIMPLE...

2007-02-01 Thread Paulo J. Matos
On 1/31/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 01/31/07 11:26: > So, ideally, I would like just the gcc part until the first part of > the middleend where you have a 'no optimizations', language > independent AST of the source file. >

Re: After GIMPLE...

2007-02-01 Thread Paulo J. Matos
On 2/1/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 02/01/07 04:37: > What can I do then to stop gcc to further process things? After > informing the user there's no more reason on my site to continue. > Stop gracefully or just stop? The latter

Disabling bootstrap

2007-02-02 Thread Paulo J. Matos
Hi all, I've changed gcc by adding a new pass, however, when I compile gcc, during compilation it calls itself, so I disabled bootstrap but that is still happening even during bootstrap. Is there any way to compile gcc without the final gcc compiling something? Moreover, how can I add a flag to

Re: Disabling bootstrap

2007-02-02 Thread Paulo J. Matos
On 2/2/07, Zdenek Dvorak <[EMAIL PROTECTED]> wrote: Hello, > I've changed gcc by adding a new pass, however, when I compile gcc, > during compilation it calls itself, so I disabled bootstrap but that > is still happening even during bootstrap. Is there any way to compile > gcc without the final

Re: After GIMPLE...

2007-02-06 Thread Paulo J. Matos
On 1/31/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 01/31/07 11:26: > So, ideally, I would like just the gcc part until the first part of > the middleend where you have a 'no optimizations', language > independent AST of the source file. >

Re: After GIMPLE...

2007-02-07 Thread Paulo J. Matos
On 2/6/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 02/06/07 14:19: > Why before pass_build_ssa? (version 4.1.1) > It depends on the properties your pass requires. If you ask for PROP_cfg and PROP_gimple_any then you should schedule it after the CFG has bee

Finalizer after pass?

2007-02-28 Thread Paulo J. Matos
Hello, I have stumbled upon a very problematic issue. I have been, through a pass, creating a structure of the gimple tree which fits my interests. However, my final need is _after_ all gimple functions are processed, to process that structure to give interesting reports to the user. Now, I stumb

Re: Finalizer after pass?

2007-03-01 Thread Paulo J. Matos
On 2/28/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 02/28/07 11:07: > Is there a way to install a finalizing function? (to be called after > all functions in the pass have been processed) > Or to know if the current function being processed is the last o

Re: Finalizer after pass?

2007-03-01 Thread Paulo J. Matos
On 3/1/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 03/01/07 10:41: > My IPA pass seems to be run only for -On, n>=1, is there a way to make > it ran even for -O0? No, we only run IPA passes if flag_unit_at_a_time is set. That only is set when optimizi

Accessing function code from CFG

2007-03-02 Thread Paulo J. Matos
Hi all, In an IPA pass, for each CFG node, I have a tree decl member from which I can access the return type, name of the function, argument names and its types, but I can't seem to find a way to get the function code. I would guess it would be a basic block list but I don't know where I can get

Re: Accessing function code from CFG

2007-03-02 Thread Paulo J. Matos
On 3/2/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 03/02/07 10:12: > In an IPA pass, for each CFG node, I have a tree decl member from > which I can access the return type, name of the function, argument > names and its types, but I can't seem to f

Adding a new gcc dir

2007-03-06 Thread Paulo J. Matos
Hi all, I've just added a new gcc subdir : head/gcc/myproj with structures and utilities for my ipa pass which lives in head/gcc. Now I have to tell gcc to compile the files inside myproj. Is there a standard way to do this? I've looked into head/gcc/Makefile.in but it seem quite cluttered and I

Re: BUG: wrong function call

2007-03-06 Thread Paulo J. Matos
On 3/6/07, W. Ivanov <[EMAIL PROTECTED]> wrote: Hi, I use multiple inheritance in my project. In the child class i have functions GetParam() and SetParam(). In the cpp-file I call GetParam() function, but I fell to SetParam() function. Can You help me? Don't take me wrong but it is most likely

Re: Adding a new gcc dir

2007-03-06 Thread Paulo J. Matos
On 3/6/07, Paulo J. Matos <[EMAIL PROTECTED]> wrote: Hi all, I've just added a new gcc subdir : head/gcc/myproj with structures and utilities for my ipa pass which lives in head/gcc. Now I have to tell gcc to compile the files inside myproj. Is there a standard way to do this? I

Re: Adding a new gcc dir

2007-03-06 Thread Paulo J. Matos
On 3/6/07, Dave Korn <[EMAIL PROTECTED]> wrote: On 06 March 2007 16:07, Paulo J. Matos wrote: > Well, added a couple of lines to gcc/Makefile.in referring to files in > myproj. Still, although it is partly working one thing is annoying me. > It's using these flags by

Re: Adding a new gcc dir

2007-03-06 Thread Paulo J. Matos
On 3/6/07, Paulo J. Matos <[EMAIL PROTECTED]> wrote: Hi all, I've just added a new gcc subdir : head/gcc/myproj with structures and utilities for my ipa pass which lives in head/gcc. Now I have to tell gcc to compile the files inside myproj. Is there a standard way to do this? I

Re: Adding a new gcc dir

2007-03-06 Thread Paulo J. Matos
On 3/6/07, Dave Korn <[EMAIL PROTECTED]> wrote: On 06 March 2007 18:22, Paulo J. Matos wrote: > i686-pc-linux-gnu-ar: symbol-tables.o: No such file or directory > > And in fact there is no symbol-tables.o but I saw it being compiled so > I wonder where it has gone to. >

Re: Adding a new gcc dir

2007-03-06 Thread Paulo J. Matos
On 3/6/07, Dave Korn <[EMAIL PROTECTED]> wrote: No, I advise that when adding a pass, regardless of whether the code can fit in a single file or is large enough to need to use several separate files, it's consistent to put all the files that implement the pass in the main 'gcc' source directory

Re: Adding a new gcc dir

2007-03-07 Thread Paulo J. Matos
On 3/7/07, Dave Korn <[EMAIL PROTECTED]> wrote: On 07 March 2007 14:30, [EMAIL PROTECTED] wrote: > Is it time to offer "second-strap" level of compilation? Ie allow C99 to > bootstrap the creation of a basic GCC compiler, then allow a second compile > using the basic GCC compiler to get the full

Re: Adding a new gcc dir

2007-03-07 Thread Paulo J. Matos
On 3/7/07, Paulo J. Matos <[EMAIL PROTECTED]> wrote: On 3/7/07, Dave Korn <[EMAIL PROTECTED]> wrote: > On 07 March 2007 14:30, [EMAIL PROTECTED] wrote: > > > Is it time to offer "second-strap" level of compilation? Ie allow C99 to > > bootstrap the creati

Re: Accessing function code from CFG

2007-03-07 Thread Paulo J. Matos
On 3/2/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 03/02/07 10:12: > In an IPA pass, for each CFG node, I have a tree decl member from > which I can access the return type, name of the function, argument > names and its types, but I can't seem to f

Re: Adding a new gcc dir

2007-03-07 Thread Paulo J. Matos
On 3/7/07, Paul Brook <[EMAIL PROTECTED]> wrote: On Wednesday 07 March 2007 14:30, [EMAIL PROTECTED] wrote: > Is it time to offer "second-strap" level of compilation? Ie allow C99 to > bootstrap the creation of a basic GCC compiler, then allow a second compile > using the basic GCC compiler to ge

Re: Accessing function code from CFG

2007-03-07 Thread Paulo J. Matos
On 3/7/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 03/07/07 10:36: > Is this normal? It seems there are no basic blocks set for the > functions. Probably my pass is being run before the bbs are created? Looks like it. Set a breakpoint in build_tree_

Re: Accessing function code from CFG

2007-03-07 Thread Paulo J. Matos
On 3/7/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Paulo J. Matos wrote on 03/07/07 11:43: > What am I missing? You are debugging the wrong binary. I'd suggest you browse through http://gcc.gnu.org/wiki/DebuggingGCC You need to debug one of cc1/cc1plus/jc1 Thank you. It

Re: Accessing function code from CFG

2007-03-07 Thread Paulo J. Matos
On 3/7/07, Paulo J. Matos <[EMAIL PROTECTED]> wrote: On 3/7/07, Diego Novillo <[EMAIL PROTECTED]> wrote: > Paulo J. Matos wrote on 03/07/07 11:43: > > > What am I missing? > > You are debugging the wrong binary. I'd suggest you browse through > http://gcc.

Re: Adding a new gcc dir

2007-03-07 Thread Paulo J. Matos
On 3/7/07, Dave Korn <[EMAIL PROTECTED]> wrote: As explained: because it makes it impossible for users running old systems with pre-C99 compilers to build gcc and thereby excludes them from the world of free software, which is the opposite of what we're trying to achieve. Well, I surely und

Libiberty functions

2007-03-08 Thread Paulo J. Matos
Hello all, when using functions from libiberty, I'm for example using xstrdup and xmalloc but free is not defined as free or xfree afail nor strlen so how should I include things? Before system.h and then standard libs or the other way around? I am almost sure it should be the other way around b

Re: Libiberty functions

2007-03-08 Thread Paulo J. Matos
Thank you all for the excellent suggestions, I'll be looking into all of your references this afternoon. Regarding my initial question, I understand I don't need free. My real problem was if I needed to include standard libraries after including system.h or if system.h would provide me free from s

MODIFY_EXPR lhs

2007-03-08 Thread Paulo J. Matos
Hello, Why is it that a left hand side of a modify_expr usually had void_type while other times it has integer, real or something else _type? One pattern I'm detecting is that when the lhs is a user variable it has void type, but when the lhs if a gcc generated variable, the modify expr has the t

Static Chain Argument in call_expr

2007-03-08 Thread Paulo J. Matos
Hello, in tree.def, in DEFTREECODE for call_expr, it says operand 2 is the static chain argument, or NULL. Can someone tell me or reference me to what static chain argument is? Cheers, -- Paulo Jorge Matos - pocm at soton.ac.uk http://www.personal.soton.ac.uk/pocm PhD Student @ ECS University of

Re: Static Chain Argument in call_expr

2007-03-08 Thread Paulo J. Matos
On 3/8/07, Duncan Sands <[EMAIL PROTECTED]> wrote: > in tree.def, in DEFTREECODE for call_expr, it says operand 2 is the > static chain argument, or NULL. Can someone tell me or reference me to > what static chain argument is? It's for nested functions, eg int parent (int n) { int child (int

On INTEGER_CST

2007-03-13 Thread Paulo J. Matos
Hello all, INTEGER_CST seems to have TREE_INT_CST_LOW and TREE_INT_CST_HIGH fields (tree.def). Each has 32 bits. 1 - Should I use ints for these fields? 2 - If the INTEGER_CST is negative, is the negative part only in one of the high or low fields, i.e. low is always unsigned and high is always s

On NULL and 0

2007-03-13 Thread Paulo J. Matos
Hello, When programming, due to my journeys through C++ recently, I've been using 0 instead of NULL. Strangely gcc compilation doesn't warn me about it. Is it ok to do this? (So far, I had no problems). Is there anything I should be aware when using 0 instead of NULL in gcc code? Cheers, -- Pau

Re: On NULL and 0

2007-03-13 Thread Paulo J. Matos
On 3/13/07, Dave Korn <[EMAIL PROTECTED]> wrote: On 13 March 2007 13:52, Paulo J. Matos wrote: > Hello, > > When programming, due to my journeys through C++ recently, I've been > using 0 instead of NULL. Strangely gcc compilation doesn't warn me > about it. Is i

Re: On INTEGER_CST

2007-03-13 Thread Paulo J. Matos
On 13 Mar 2007 07:58:41 -0700, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: "Paulo J. Matos" <[EMAIL PROTECTED]> writes: > INTEGER_CST seems to have TREE_INT_CST_LOW and TREE_INT_CST_HIGH > fields (tree.def). Each has 32 bits. No, each has type HOST_WIDE_INT. On a

Referenced Vars in IPA pass

2007-03-13 Thread Paulo J. Matos
Hi all, In #gcc, it was suggested to use referenced vars to get all the referenced vars for a function. I added to my IPA pass props, PROP_referenced_vars , used push_cfun and then FOR_EACH_REFERENCED_VAR, however, it just segfaults in tree-flow-inline.h:34 : hti->slot = table->entries; It was s

Re: Referenced Vars in IPA pass

2007-03-13 Thread Paulo J. Matos
On 3/13/07, Paolo Bonzini <[EMAIL PROTECTED]> wrote: > int x; > { > int y; > { > int z; > ... > } > ... > } > > just happens to have three statements, all VAR_DECL,x, y, z, without > any reference to the starting and ending blocks. As a side

Re: Referenced Vars in IPA pass

2007-03-13 Thread Paulo J. Matos
On 3/13/07, Paolo Bonzini <[EMAIL PROTECTED]> wrote: > int x; > { > int y; > { > int z; > ... > } > ... > } > > just happens to have three statements, all VAR_DECL,x, y, z, without > any reference to the starting and ending blocks. As a side

Re: Referenced Vars in IPA pass

2007-03-13 Thread Paulo J. Matos
On 3/13/07, Jeffrey Law <[EMAIL PROTECTED]> wrote: On Tue, 2007-03-13 at 18:09 +0100, Paolo Bonzini wrote: > > int x; > > { > > int y; > > { > > int z; > > ... > > } > > ... > > } > > > > just happens to have three statements, all VAR_DECL,x,

Re: Referenced Vars in IPA pass

2007-03-13 Thread Paulo J. Matos
On 3/13/07, Daniel Berlin <[EMAIL PROTECTED]> wrote: Uh, since when did 4.1 support IPA GIMPLE? What do you mean by that? -- Paulo Jorge Matos - pocm at soton.ac.uk http://www.personal.soton.ac.uk/pocm PhD Student @ ECS University of Southampton, UK

Re: Referenced Vars in IPA pass

2007-03-13 Thread Paulo J. Matos
On 3/13/07, Richard Guenther <[EMAIL PROTECTED]> wrote: On 3/13/07, Daniel Berlin <[EMAIL PROTECTED]> wrote: > On 3/13/07, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > > On 3/13/07, Daniel Berlin <[EMAIL PROTECTED]> wrote: > > > Uh, since when did 4.1 su

EH references

2007-04-16 Thread Paulo J. Matos
Hello all, Is that any reference (paper, guide, whatever,) on how gcc is handling exceptions in intermediate code? Is it based on a known (published) method? Is it intuitive and explained somewhere? I've looked at internal docs but it is not really explicit how it works. I'm having a hard time u

Duplicate assembler function names in cgraph

2007-04-16 Thread Paulo J. Matos
Hello all, I'm doing in my IPA pass: for(node = cgraph_nodes; node; node = node->next) { reg_cgraph_node(IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(node->decl))); } to get all the function names in the cgraph. I'm adding them to a list and I'm assuming that two nodes do not have the same DECL_ASS

Builtin functions?

2007-04-16 Thread Paulo J. Matos
Hello all, I'm going through the bodies of all user-defined functions. I'm using as user-defined function as one that: DECL_BUILT_IN(node) == 0. Problem is that for a function (derived from a C++ file) whose output from my pass is (output is self-explanatory, I think): Registering cgraph node:

Re: Builtin functions?

2007-04-16 Thread Paulo J. Matos
On 4/16/07, Daniel Jacobowitz <[EMAIL PROTECTED]> wrote: On Mon, Apr 16, 2007 at 05:04:05PM +0100, Paulo J. Matos wrote: > _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc > [operator<<]... SUCCESSFUL > Well, this is definitely builtin but DECL_BUILT_IN == 0, which m

Re: Builtin functions?

2007-04-16 Thread Paulo J. Matos
On 4/16/07, Daniel Berlin <[EMAIL PROTECTED]> wrote: First, it's not built in, because it's defined in a source file. Builtin functions are those defined by the compiler. Second, we should make FOR_EACH_BB_FN never crash on empty tree functions. It seems really rude to do otherwise. Just becaus

Re: Duplicate assembler function names in cgraph

2007-04-16 Thread Paulo J. Matos
On 4/16/07, Jan Hubicka <[EMAIL PROTECTED]> wrote: Hi, > Hello all, > > I'm doing in my IPA pass: > for(node = cgraph_nodes; node; node = node->next) { >reg_cgraph_node(IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(node->decl))); > } > > to get all the function names in the cgraph. I'm adding them t

Re: Builtin functions?

2007-04-17 Thread Paulo J. Matos
On 4/16/07, Jan Hubicka <[EMAIL PROTECTED]> wrote: > > If you just want to scan every function you have around, the obvious > way to do it is > > For each function > FOR_EACH_BB_FN (function). > > This is probably slightly slower than > > For each function > if cgraph_function_body_availability

Re: EH references

2007-04-17 Thread Paulo J. Matos
Thank you for the references at Code Sourcery, regading SJLJ exception handling I found the paper (which references it): "Exception Handling in the Choices Operating System", is the reference for SJLJ EH? Cheers, -- Paulo Jorge Matos - pocm at soton.ac.uk http://www.personal.soton.ac.uk/pocm PhD

Re: Duplicate assembler function names in cgraph

2007-04-17 Thread Paulo J. Matos
On 4/16/07, Jan Hubicka <[EMAIL PROTECTED]> wrote: > > Sure, however, I'm developing over 4.1.1, still you might still have > the error on current head, (I know 4.1.1 is quite old). What do you > mean by a test case? Do you want a short version of my IPA pass which > shows up the issue? Either th

Re: Duplicate assembler function names in cgraph

2007-04-17 Thread Paulo J. Matos
On 4/17/07, Mike Stump <[EMAIL PROTECTED]> wrote: On Apr 17, 2007, at 3:11 AM, Paulo J. Matos wrote: > I wonder, that if I am to use gcc head, how can I do that? This isn't a trick question is it? Anyway, it is answered by our web site. Briefly, you check out trunk and th

loop hoisting fails

2011-02-09 Thread Paulo J. Matos
Hi, I am facing a problem with code hoisting from a loop in our backend. This problem seems to be hinted at on: -fbranch-target-load-optimize Perform branch target register load optimization before prologue / epilogue threading. The use of target registers can typically be exposed only dur

Re: loop hoisting fails

2011-02-09 Thread Paulo J. Matos
On 09/02/11 15:07, Ian Lance Taylor wrote: You need to set TARGET_RTX_COSTS to indicate that this operation is relatively expensive. That should stop combine from generating it. Thanks, I will give it a try. One of the things that are not as polished as it should is exactly the rtx costs. I

Re: loop hoisting fails

2011-02-10 Thread Paulo J. Matos
On 09/02/11 15:57, Ian Lance Taylor wrote: For your processor it sounds like you should make a constant more expensive than a register for an outer code of SET. You're right that the cost should really depend on the destination of the set but unfortunately I don't know if you will see that. I a

Re: loop hoisting fails

2011-02-10 Thread Paulo J. Matos
On 09/02/11 15:57, Ian Lance Taylor wrote: For your processor it sounds like you should make a constant more expensive than a register for an outer code of SET. You're right that the cost should really depend on the destination of the set but unfortunately I don't know if you will see that. I

Re: loop hoisting fails

2011-02-10 Thread Paulo J. Matos
On 10/02/11 16:04, Ian Lance Taylor wrote: Bother. I've encountered that problem before and I think I used a sledgehammer (a local patch). It's definitely a bug that gcse doesn't consider costs. At least I am happy that you confirm this. :) Have you reported a bug for this before?

Re: loop hoisting fails

2011-02-10 Thread Paulo J. Matos
On 10/02/11 17:59, Richard Henderson wrote: If constants are never valid as the source of a store, They are but it really depends to which registers they are going to. If the destination belongs to a certain class it is ok, for all the others it is not. It is tricky even to define costs when

Re: loop hoisting fails

2011-02-10 Thread Paulo J. Matos
On 10/02/11 16:04, Ian Lance Taylor wrote: Bother. I've encountered that problem before and I think I used a sledgehammer (a local patch). It's definitely a bug that gcse doesn't consider costs. I think I might try also patching my local gcc. I guess the trick is to check for the cost of th

Re: Reloading an auto-increment addresses

2011-02-11 Thread Paulo J. Matos
On 11/02/11 09:46, Mohamed Shafi wrote: How can i overcome this failure? Can some one suggest a solution? Have you defined TARGET_LEGITIMATE_ADDRESS_P and also BASE_REG_CLASS correctly for your target?

Volatile memory is not general operand

2011-02-11 Thread Paulo J. Matos
Hi, I just noticed something very surprising. There's a clause in general_operand (recog.c): if (! volatile_ok && MEM_VOLATILE_P (op)) return 0; Oh... so, a MEM_VOLATILE_P is _not_ a general operand? Why? This is also not referred to in the documentation of general operand so it

Re: Volatile memory is not general operand

2011-02-11 Thread Paulo J. Matos
On 11/02/11 12:03, Eric Botcazou wrote: if (! volatile_ok&& MEM_VOLATILE_P (op)) return 0; . It's more of the other way around: MEM_VOLATILE_P is a general operand unless explicitly requested via init_recog_no_volatile. Some passes, like combine, don't track the volatileness o

Re: Volatile memory is not general operand

2011-02-11 Thread Paulo J. Matos
On 11/02/11 13:56, Michael Matz wrote: The piece of code you quoted also is conditional on volatile_ok. Connect that with what Eric said. Thanks Michael, I guess I should sleep before asking anything else. Now I understand what Eric said.

Re: loop hoisting fails

2011-02-14 Thread Paulo J. Matos
On 11/02/11 19:41, Ian Lance Taylor wrote: My case was somewhat different. I think I just patched gcse_constant_p. Thanks!

Using cc (question from avr)

2011-03-09 Thread Paulo J. Matos
Hi, I am having some trouble really understanding the working of cc_status. In order to understand it better I was looking at the code for avr under gcc 4.3. My assumption is that set_zn, set_* means that an instructions _changes_ these flags. So an instruction that set_zn means that Z and N

mov arguments are still the same

2011-03-16 Thread Paulo J. Matos
Hi, I have touched this subject before: http://thread.gmane.org/gmane.comp.gcc.devel/116198/focus=116200 Now, at the time I didn't pursue this issue but now with 4.4.4 this keeps happening and I traced it to the cprop_hardreg replacing a register which makes the set insn having the same source

avr compilation

2011-03-18 Thread Paulo J. Matos
Hi all, I am looking at the avr backend in order to try to sort some things out on my own backend. One of the tests I am doing is by compiling the following: int x = 0x1010; int y = 0x0101; int add(void) { return x+y; } It compiles to (in gcc-4.3.5_avr with -Os) add: /* prologue: function

Re: avr compilation

2011-03-18 Thread Paulo J. Matos
ss it's probably something else... Best, Jiong On 03/18/2011 04:47 PM, Paulo J. Matos wrote: Hi all, I am looking at the avr backend in order to try to sort some things out on my own backend. One of the tests I am doing is by compiling the following: int x = 0x1010; int y = 0x0101;

Re: avr compilation

2011-03-18 Thread Paulo J. Matos
On 18/03/11 12:10, David Brown wrote: If you are digging through the AVR backend and find ways to improve code sequences like this, the avr-gcc community would be very grateful. There is an avr-gcc mailing list at , which may be of interest

Re: avr compilation

2011-03-18 Thread Paulo J. Matos
On 18/03/11 13:26, Georg-Johann Lay wrote: note that the last moves are two QI moves, the add is HI. Yes, correct, this seems to cause some confusion on gcc side then... humm! Without splitting HI the moves will disappear, try -fno-split-wide-types. It does work! It's enabled by -O1, mayb

Re: avr compilation

2011-03-18 Thread Paulo J. Matos
On 18/03/11 14:20, Ian Lance Taylor wrote: -fsplit-wide-types is an improvement on most targets, in which ints and pointers have the size UNITS_PER_WORD. On AVR that appears not to be the case, and it seems possible that AVR should set flag_split_wide_types to 0 in TARGET_OPTION_OPTIMIZATION_TA

Re: mov arguments are still the same

2011-03-24 Thread Paulo J. Matos
Let me revive this thread and ask for suggestions/tips on the issue below. Cheers, PMatos On 16/03/11 18:19, Paulo J. Matos wrote: Hi, I have touched this subject before: http://thread.gmane.org/gmane.comp.gcc.devel/116198/focus=116200 Now, at the time I didn't pursue this issue bu

Re: Supporting multiple pointer sizes in GCC

2011-03-31 Thread Paulo J. Matos
On 30/03/11 08:57, Claudiu Zissulescu wrote: Hi, I would try using the named address space for your issue (see TARGET_ADDR_SPACE_POINTER_MODE). Please check the SPU target for an implementation example. Hummm, I haven't noticed this hook before. Could this be used to implement cases where fu

Truncating df to sf (and typo in code)

2011-04-13 Thread Paulo J. Matos
Hi, I have been looking at the fp-bit code and noticed: /* numeric parameters */ /* F_D_BITOFF is the number of bits offset between the MSB of the mantissa of a float and of a double. Assumes there are only two float types. (double::FRAC_BITS+double::NGARDS-(float::FRAC_BITS-float::NGARDS))

Volatile memory move

2011-04-15 Thread Paulo J. Matos
Hi, I am running into trouble with a volatile memory move on my port of GCC4.4.4. The code is: int main(void) { register volatile float sc = 1E35; if(sc < 1.5e35) return 1; return 0; } The very first part of this code is being expanded as: ;; sc ={v} 1.00040918478759629

MULTILIB_EXTRA_OPTS and LIBGCC2_CFLAGS

2011-06-17 Thread Paulo J. Matos
Hi all, I am quite confused about the difference between the above two options in Makefile fragments. They both seem to be doing the same thing which is to set the options to build libgcc2 with. The only thing that comes to mind is that LIBGCC2_CFLAGS only applies to the main library and M

Re: MULTILIB_EXTRA_OPTS and LIBGCC2_CFLAGS

2011-06-17 Thread Paulo J. Matos
On 17/06/11 15:22, Ian Lance Taylor wrote: LIBGCC2_CFLAGS applies only to libgcc (all multilib versions of libgcc). MULTILIB_EXTRA_OPTS applies to all target libraries (libstdc++, libjava, libgo, etc.). Thanks for clearing that up for me. Since I am focused on the C frontend only I actually

LIBGCC2_FLAGS not used by libgcc2 configure?

2011-06-17 Thread Paulo J. Matos
Hi, There are some flags that are needed by the target to build libgcc2. I am keeping those in TARGET_LIBGCC2_FLAGS. However, compilation is failed even before the building begins because configure fails. While trying to compile test programs configure is using TARGET_LIBGCC2_FLAGS. This see

Re: LIBGCC2_FLAGS not used by libgcc2 configure?

2011-06-20 Thread Paulo J. Matos
On 18/06/11 00:00, Ian Lance Taylor wrote: You are saying that configure is using TARGET_LIBGCC2_FLAGS, but that you want to set something so that it uses TARGET_LIBGCC2_FLAGS? Are you missing a "not" in there somewhere? Or do I misunderstand? Thanks for the reply Ian. I am using MULTILIBS.

Re: LIBGCC2_FLAGS not used by libgcc2 configure?

2011-06-20 Thread Paulo J. Matos
On 20/06/11 13:08, Ian Lance Taylor wrote: Yes, it's libgcc/configure that's failing. So, you mean I should MULTILIB_EXTRA_OPTS=-mas-mode in my t- makefile fragment? Yes. I will give that a try. Alternatively, you implied that your backend always needs this option. In that case you could m

Re: LIBGCC2_FLAGS not used by libgcc2 configure?

2011-06-22 Thread Paulo J. Matos
On 21/06/11 19:01, Ian Lance Taylor wrote: CFLAGS. CFLAGS_FOR_BUILD is for code compiled for the build system. CFLAGS is for code compiled for the host system. CFLAGS_FOR_TARGET is for code compiled for the target system. The driver and the compiler as a whole run on the host system. The bu

__function_size builtin

2011-06-22 Thread Paulo J. Matos
Hello, I have added a builtin __function_size that is supposed to receive a pointer to a function and return the size, in words, that the function takes. We got it working until GCC4.5. In GCC4.5 became tricky for 2 reasons. First, GCC 4.5 removes the function if the only reference to the f

  1   2   3   4   >