This is the mail archive of the gcc-bugs@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]

Previously applied patch- force PR to be live, causes problem in gcc-3.0.2 for SH target


Hi,
As per my study and understanding the following patch is causing the problem
decribed below.

* sh.c (initial_elimination_offset): When seeing
 RETURN_ADDRESS_POINTER_REGNUM, force pr to be live.
http://gcc.gnu.org/ml/gcc-cvs/2001-09/msg00359.html

This causes the PR to be saved on stack and restored even though there is
no function call from within a function. So if there is a function e.g.
hardware_initialize
which has memory initialization in it, called from a assembly file, causes
an error as GCC3.0.2 stores the PR
on to stack and stack is not yet available.
e.g. for the following small program and generated assembly code is :

extern void hardware_initialize(void);   //called from assembly startup
routine
void prtest(void)
{
}
Assembly -
        .file   "prtest.c"
        .text
        .align 2
        .global _prtest
        .type   _prtest,@function
_prtest:
        mov.l   r14,@-r15
        sts.l   pr,@-r15
        mov     r15,r14
        mov     r14,r15
        lds.l   @r15+,pr
        mov.l   @r15+,r14
        rts
        nop
.Lfe1:
        .size   _prtest,.Lfe1-_prtest
        .ident  "GCC: (GNU) 3.0.2"

As this feature was not there in gcc-3.0.1 it works fine for the c function
called from assembly.
Is it possible to fix the PR?
Any help will be appreciated.

Many thanks in advance.

Regards,
Anita Kulkarni

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Free download and free European support of GNU tool
     chain (GNUSH v0101) for Hitachi's SH Series
Read more at http://www.kpit.com/products/support.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




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