On Wed, 2011-08-24 at 16:05 -0500, Peter Bigot wrote:
> Look at msp430-builtins.c in the implementation for delay cycles for
> examples of generating local labels, comparison, and jump
> instructions.  You can probably use something like gen_rtx_MEM (Pmode,
> gen_rtx_SYMBOL_REF (HImode, "__stack_base")) and use that to compare
> against stack_pointer_rtx rather than having to push and pop r15.

Sorry for being so "helpless", but I looked at msp430-builtins.c and
most of the code for delay cycles seems to just compute the number of
required cycles. The only thing that is RTL related is a call to
gen_delay_cycles() [which I never found the declaration for] and an
emit_insn().

Perhaps I'm looking in the wrong place. I'm on the top commit on the
master branch of git://mspgcc.git.sourceforge.net/gitroot/mspgcc/mspgcc

> The ICEs are likely if you don't set RTX_FRAME_RELATED_P on the prolog
> insns that access the stack pointer.

Digging through GCC code I managed to find emit_cmp_and_jump_insns() but
I have no reference to the generated insns to set RTX_FRAME_RELATED_P. I
guess it makes sense though not to return any insn, since it may
generate more than just one.

> If you get it working solidly, please file a tracker ticket on the
> mspgcc project and submit a patch for review and incorporation into
> the development branches.  The final version should set a new frame
> flag in msp430_set_current_function, and implement it in
> expand_prologue, probably right before MSP430_FF_prologue_eint.

Considering my lack of experience with RTL api, I think it's a long way
to go before getting it to work at least "for experimental purposes".
But of course, I want to share my work with the community :)

> You might also want to look at what -fstack-check really does and
> whether what you describe is compatible with its use on other
> platforms.  A quick check suggests it's mostly implemented in the
> middle-end and may result in code generated that depends on some
> runtime support for stack probes.  -mstack-check may be more
> appropriate for the approach you describe.

I'll look into this as well. Thanks for all the suggestions!

Best regards,

Radu


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to