public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dave dot korn dot cygwin at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/38952] [4.4 Regression] EH does not work.
Date: Sun, 25 Jan 2009 06:34:00 -0000	[thread overview]
Message-ID: <20090125063350.23909.qmail@sourceware.org> (raw)
In-Reply-To: <bug-38952-9431@http.gcc.gnu.org/bugzilla/>



------- Comment #15 from dave dot korn dot cygwin at gmail dot com  2009-01-25 06:33 -------
(In reply to comment #14)
> And that is presumably the intention of this if clause in ix86_can_eliminate:
> 
>   if (stack_realign_fp)
>     return ((from == ARG_POINTER_REGNUM
>              && to == HARD_FRAME_POINTER_REGNUM)
>             || (from == FRAME_POINTER_REGNUM
>                 && to == STACK_POINTER_REGNUM));
>   else [ ... ]
> 

  I just looked twice at that and it seemed odd to me.  Testing this:

   if (stack_realign_fp)
     return ((from == ARG_POINTER_REGNUM
              && to == HARD_FRAME_POINTER_REGNUM)
             || (from == FRAME_POINTER_REGNUM
-                && to == STACK_POINTER_REGNUM));
+                && to == HARD_FRAME_POINTER_REGNUM));


gives me this:

(gdb) disass main
Dump of assembler code for function main:
0x00401070 <main+0>:    push   %ebp
0x00401071 <main+1>:    mov    %esp,%ebp
0x00401073 <main+3>:    and    $0xfffffff0,%esp
0x00401076 <main+6>:    push   %edi
0x00401077 <main+7>:    push   %esi
0x00401078 <main+8>:    push   %ebx
0x00401079 <main+9>:    sub    $0x54,%esp
0x0040107c <main+12>:   movl   $0x4075f0,-0x34(%ebp)
0x00401083 <main+19>:   movl   $0x407bc4,-0x30(%ebp)
0x0040108a <main+26>:   lea    -0x2c(%ebp),%eax
0x0040108d <main+29>:   lea    -0x18(%ebp),%edx
0x00401090 <main+32>:   mov    %edx,(%eax)
0x00401092 <main+34>:   mov    $0x4010e2,%edx
0x00401097 <main+39>:   mov    %edx,0x4(%eax)
0x0040109a <main+42>:   mov    %esp,0x8(%eax)
0x0040109d <main+45>:   lea    -0x4c(%ebp),%eax
0x004010a0 <main+48>:   mov    %eax,(%esp)
0x004010a3 <main+51>:   call   0x405058 <_Unwind_SjLj_Register>

Which works, but now I suspect the address calculations accessing the jmp_buf
are going to be wrong.  Argh.  It looks like we have to know whether there's
an offset in the mem rtx relating to FRAME_POINTER_REGNUM and if it's negative
we have to allow elimination against STACK_POINTER but if its zero or positive
we'd have to only allow elimination against HARD_FRAME_POINTER ... ouch.

Guess the next thing I'll try is simply not allowing elimination against
FRAME_POINTER at all in this context.  That'll mean we can't
-fomit-frame-pointer
in functions which have stack_realign_fp true, but it beats wrong code and
maybe there's a way of avoiding it that I haven't thought of.  Now testing:

   if (stack_realign_fp)
     return ((from == ARG_POINTER_REGNUM
              && to == HARD_FRAME_POINTER_REGNUM)
             || (from == FRAME_POINTER_REGNUM
-                && to == STACK_POINTER_REGNUM));
+                && 0));


-- 


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


  parent reply	other threads:[~2009-01-25  6:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-23 23:20 [Bug target/38952] New: " dave dot korn dot cygwin at gmail dot com
2009-01-23 23:31 ` [Bug target/38952] " dave dot korn dot cygwin at gmail dot com
2009-01-23 23:31 ` dave dot korn dot cygwin at gmail dot com
2009-01-23 23:32 ` dave dot korn dot cygwin at gmail dot com
2009-01-23 23:44 ` dave dot korn dot cygwin at gmail dot com
2009-01-24  0:10 ` dave dot korn dot cygwin at gmail dot com
2009-01-24  1:08 ` dave dot korn dot cygwin at gmail dot com
2009-01-24  6:24 ` dave dot korn dot cygwin at gmail dot com
2009-01-24  8:47 ` rguenth at gcc dot gnu dot org
2009-01-24 17:07 ` ubizjak at gmail dot com
2009-01-24 18:12 ` dave dot korn dot cygwin at gmail dot com
2009-01-24 21:41 ` hjl dot tools at gmail dot com
2009-01-25  5:33 ` dave dot korn dot cygwin at gmail dot com
2009-01-25  5:56 ` dave dot korn dot cygwin at gmail dot com
2009-01-25  5:58 ` dave dot korn dot cygwin at gmail dot com
2009-01-25  6:05 ` dave dot korn dot cygwin at gmail dot com
2009-01-25  6:34 ` dave dot korn dot cygwin at gmail dot com [this message]
2009-01-25  6:40 ` dave dot korn dot cygwin at gmail dot com
2009-01-25  7:47 ` dave dot korn dot cygwin at gmail dot com
2009-01-25 21:36 ` dave dot korn dot cygwin at gmail dot com
2009-01-25 23:08 ` dave dot korn dot cygwin at gmail dot com
2009-01-26 11:49 ` Joey dot ye at intel dot com
2009-01-26 19:03 ` dave dot korn dot cygwin at gmail dot com
2009-01-26 22:29 ` hjl dot tools at gmail dot com
2009-01-26 23:39 ` hjl at gcc dot gnu dot org
2009-01-31 17:21 ` ktietz at gcc dot gnu dot org
2009-01-31 17:34 ` hjl at gcc dot gnu dot org
2009-01-31 17:35 ` hjl dot tools at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090125063350.23909.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).