public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56960] New: How to set up stack pointer in gcc 4.7.2
@ 2013-04-15  5:59 deepak.kansl at gmail dot com
  2013-04-15  6:05 ` [Bug other/56960] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: deepak.kansl at gmail dot com @ 2013-04-15  5:59 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56960

             Bug #: 56960
           Summary: How to set up stack pointer in gcc 4.7.2
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: deepak.kansl@gmail.com


void
spim_prologue(void)
{
        int i,j;

       
emit_move_insn(gen_rtx_MEM(SImode,plus_constant(stack_pointer_rtx,-0)),return_addr_rtx);
       
emit_move_insn(gen_rtx_MEM(SImode,plus_constant(stack_pointer_rtx,-4)),stack_pointer_rtx);
       
emit_move_insn(gen_rtx_MEM(SImode,plus_constant(stack_pointer_rtx,-8)),hard_frame_pointer_rtx);
        emit_move_insn(hard_frame_pointer_rtx,
plus_constant(stack_pointer_rtx,0));
        for(i=0,j=4;i<FIRST_PSEUDO_REGISTER;i++)
        {
                if(df_regs_ever_live_p(i) && !call_used_regs[i] &&
!fixed_regs[i])
                {
                       
emit_move_insn(gen_rtx_MEM(SImode,plus_constant(hard_frame_pointer_rtx,-4*j)),
gen_rtx_REG(SImode,i));
                        j++;
                }
        }
        emit_insn(gen_rtx_SET(SImode,
stack_pointer_rtx,plus_constant(hard_frame_pointer_rtx,-((3+j+1)*4+get_frame_size()))
));  //HERE is what error comes
}

The last statement of the program is producing a segmentation fault when I
compile a program. It worked fine when it was built on gcc-4.6.2 but creating
problem for 4.7.2.  Can anyone help me out?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug other/56960] How to set up stack pointer in gcc 4.7.2
  2013-04-15  5:59 [Bug c/56960] New: How to set up stack pointer in gcc 4.7.2 deepak.kansl at gmail dot com
@ 2013-04-15  6:05 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-04-15  6:05 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56960

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |other
         Resolution|                            |WONTFIX

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-04-15 06:05:16 UTC ---
bugzilla is not the right place to ask this question.  Bugzilla is for bugs
against the clean sources except for the old case where you already debugged
what is going wrong.

Try using a debugger first to see why it is segfaulting and if that fails then
write to gcc@ rather than bugzilla.

Could it be because stack_pointer_rtx is NULL at this point?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-15  6:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-15  5:59 [Bug c/56960] New: How to set up stack pointer in gcc 4.7.2 deepak.kansl at gmail dot com
2013-04-15  6:05 ` [Bug other/56960] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).