This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: constant pool issues


Mihai Burcea wrote:
Q1: where are global consts held ? is there a "global" constant pool, or is that just the pool for the "main" function ?

There can be multiple constant pools, and they can work differently for different targets. You really shouldn't have to worry about this though if you are just generating rtl. Just generate RTL, and a constant will be put in the constant pool if necessary, and it will be put in which ever one it needs to be put in.


Q2: Is there any way to assign some double constant value to a variable other than using the constant pool ?

You do not use the constant pool for assigning values. Constants are put in the constant pool if the target requires this.


If you want to do an assignment, you just generate rtl, for instance, by calling emit_move_insn. Either emit_move_insn or the target's movdf pattern might force the constant into the constant pool, but that doesn't matter.

Q3: How do I assign the values to the variables ?

Just call emit_move_insn if you have rtl, or expand_expr if you have trees.


Q4: Is it possible to tell, from within RTL, what variable an "*.LCx" (where x is 0, 1, etc) is associated with ?

Often there will be a REG_EQUAL note that will contain the value. Otherwise, you probably can't tell what the value is solely by looking at the RTL.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]