public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iains at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/50091] [4.5/4.6/4.7 Regression] -fstack-check gives bad assembly on powerpc-apple-darwin9
Date: Sat, 20 Aug 2011 14:22:00 -0000	[thread overview]
Message-ID: <bug-50091-4-O6USOQ4yua@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50091-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> 2011-08-20 13:02:19 UTC ---
(In reply to comment #4)
> If I edit the assembly code to have
> 
> ...
>         stw r0,-12284(r1)
>         mr r0,r1
>         stw r0,-12556(r1)
> ...
> 
> The code assembles, links and runs without further hiccup.

rs6000.md:

(define_insn "probe_stack"
  [(set (match_operand 0 "memory_operand" "=m")
        (unspec [(const_int 0)] UNSPEC_PROBE_STACK))]
  ""
  "{st%U0%X0|stw%U0%X0} 0,%0"
  [(set_attr "type" "store")
   (set_attr "length" "4")])

it appears (to one with near zero experience of md files) that the intent of
the insn is to store a  value (0) into the location (thus probing the stack). 
Presumably, one gets a segfault or bus error in the case of fail.

The i386 equivalent stores $0 into the location ... but I suppose any value or
register would do.

Presumably, for PPC assemblers that don't use the 'r' prefix on the registers,
it will be storing r0 into the slot (effectively, what Dominique's hand-edit is
doing). 

 I guess there's some really obvious way to fix this... but I don't (yet) know
the syntax of the md stuff ..


  parent reply	other threads:[~2011-08-20 13:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15 15:26 [Bug target/50091] New: " dominiq at lps dot ens.fr
2011-08-16  8:42 ` [Bug target/50091] " rguenth at gcc dot gnu.org
2011-08-16 17:23 ` ebotcazou at gcc dot gnu.org
2011-08-16 17:28 ` pinskia at gmail dot com
2011-08-17 22:39 ` dominiq at lps dot ens.fr
2011-08-20 14:22 ` iains at gcc dot gnu.org [this message]
2011-08-20 14:52 ` schwab@linux-m68k.org
2011-09-03 13:29 ` ebotcazou at gcc dot gnu.org
2011-09-03 14:20 ` iains at gcc dot gnu.org
2011-09-03 14:45 ` ebotcazou at gcc dot gnu.org
2011-09-03 14:46 ` ebotcazou at gcc dot gnu.org
2011-09-03 16:48 ` iains at gcc dot gnu.org
2011-09-03 17:29 ` ebotcazou at gcc dot gnu.org
2011-09-04 11:19 ` iains at gcc dot gnu.org
2011-09-04 13:02 ` ebotcazou at gcc dot gnu.org
2011-09-04 15:29 ` iains at gcc dot gnu.org
2011-09-18 22:04 ` [Bug target/50091] [4.5/4.6/4.7 Regression] -fstack-check generates wrong assembly ebotcazou at gcc dot gnu.org
2011-09-18 22:05 ` ebotcazou at gcc dot gnu.org
2011-09-18 22:33 ` ebotcazou at gcc dot gnu.org
2011-09-18 23:32 ` ebotcazou at gcc dot gnu.org

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=bug-50091-4-O6USOQ4yua@http.gcc.gnu.org/bugzilla/ \
    --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).