This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

target/8728: using alloca and -finstrument-functions causes a seg fault on powerpc-apple-darwin6.2


>Number:         8728
>Category:       target
>Synopsis:       using alloca and -finstrument-functions causes a seg fault on powerpc-apple-darwin6.2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 26 18:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Pinski
>Release:        gcc version 3.3 20021126 (experimental)
>Organization:
>Environment:
6.2 Darwin Kernel Version 6.2: Tue Nov  5 22:00:03 PST 2002; root:xnu/xnu-344.12.2.obj~1/RELEASE_PPC  Power Macintosh powerpc
>Description:
Using alloca with a non constant and -finstrument-functions causes a seg fault on powerpc-apple-darwin6.2:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void __attribute__((__no_instrument_function__)) __cyg_profile_func_enter (void *tfn,  void *csite)
{
}
void __attribute__((__no_instrument_function__)) __cyg_profile_func_exit (void *tfn,  void *csite)
{
}
void foo(char *temp)
{
    char *temp123 = alloca(strlen(temp));
    strcpy(temp123, temp);
    printf("%s", temp123);
}

int main()
{
    int i;
    for(i=0;i<10000;i++)
    {
        foo("Hi");
    }
    return 0;
}
>How-To-Repeat:
compile the program and run it, it should produce many Hi's.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]