[Bug target/50091] [4.5/4.6/4.7 Regression] -fstack-check gives bad assembly on powerpc-apple-darwin9

iains at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Aug 20 14:22:00 GMT 2011


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 ..



More information about the Gcc-bugs mailing list