From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23713 invoked by alias); 24 Apr 2002 12:34:39 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 23549 invoked from network); 24 Apr 2002 12:33:19 -0000 Received: from unknown (HELO mail.redhat.de) (193.103.254.4) by sources.redhat.com with SMTP; 24 Apr 2002 12:33:19 -0000 Message-ID: <3CC6A60B.9080800@redhat.com> Date: Wed, 24 Apr 2002 05:45:00 -0000 From: Manfred Hollstein X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Scholz Maik (CM-CR/EES3) *" Cc: "'gcc@gcc.gnu.org'" Subject: Re: howto use -fstack-check References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg01235.txt.bz2 Scholz Maik (CM-CR/EES3) * wrote: > small example: > foo.c: > void foo2() > { > } > > void foo1() > { > int i; > i = 1; > foo2(); > } > > miplsisa32-elf -S -fstack-check > foo.s: > .file 1 "foo.c" > .section .text > gcc2_compiled.: > __gnu_compiled_c: > .text > .align 2 > .globl foo2 > .ent foo2 > foo2: > .frame $fp,16,$31 # vars= 0, regs= 1/0, args= 0, > extra= 0 > .mask 0x40000000,-16 > .fmask 0x00000000,0 > subu $sp,$sp,16 > sw $fp,0($sp) > move $fp,$sp > move $sp,$fp > lw $fp,0($sp) > addu $sp,$sp,16 > j $31 > .end foo2 > .align 2 > .globl foo1 > .ent foo1 > foo1: > .frame $fp,32,$31 # vars= 16, regs= 2/0, args= 0, > extra= 0 > .mask 0xc0000000,-12 > .fmask 0x00000000,0 > subu $sp,$sp,32 > sw $31,20($sp) > sw $fp,16($sp) > move $fp,$sp > added code | addu $2,$sp,-4392 > added code | #.set volatile > added code | sw $0,0($2) > added code | #.set novolatile > li $2,1 # 0x1 > sw $2,0($fp) > jal foo2 > move $sp,$fp > lw $31,20($sp) > lw $fp,16($sp) > addu $sp,$sp,32 > j $31 > .end foo1 I'm not really MIPS aware, but assuming "addu" means "add unsigned" and "sw" means "store word" I cannot imagine how those added insns are of any use. > > Is there any description how to use the > "extra generated code". gccint.info describes three alternatives available to gcc hackers who want to implement stack checking for their particular port, but other than that, I'm afraid, no. > > Regards > > Maik > Cheers. l8er manfred -- Manfred Hollstein Red Hat GmbH GPG fingerprint: 1D1F 0F5A 32C1 9E2A B8BA 561A E372 AF4C 0581 D831