This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/9544: buggy prolog code generation for functions, make room for local vars
- From: reza_agha at yahoo dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 3 Feb 2003 13:43:56 -0000
- Subject: c/9544: buggy prolog code generation for functions, make room for local vars
- Reply-to: reza_agha at yahoo dot com
>Number: 9544
>Category: c
>Synopsis: buggy prolog code generation for functions, make room for local vars
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Mon Feb 03 13:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Reza A. Naini
>Release: 2.95.2 19991024 (release) AVR version
>Organization:
>Environment:
Win2K
>Description:
the prolog code of function when want to make room for local variables, is buggy.
void aFunction(void)
{
char localVars[100];
}
is translated to:
in r0,SREG
cli <----
preperation code for local variables
sei <---- BUG!
the I (interrupt) flag is set at beginning of this function.
>How-To-Repeat:
char global[100];
void aFunction(void)
{
char local[100];
int i;
for(i=0; i<100; i++)
global[i] = local[i];
}
>Fix:
prolog code must be:
in r0,SREG
cli
.......
out SREG,r0 <---- Fix!
>Release-Note:
>Audit-Trail:
>Unformatted: