This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
optimization/7351: Postincrment optimisation problem
- From: geert dot deprins at advalvas dot be
- To: gcc-gnats at gcc dot gnu dot org
- Cc: geert dot deprins at utimaco dot be
- Date: 18 Jul 2002 17:50:45 -0000
- Subject: optimization/7351: Postincrment optimisation problem
- Reply-to: geert dot deprins at advalvas dot be
>Number: 7351
>Category: optimization
>Synopsis: Postincrment optimisation problem
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 18 10:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Geert De Prins
>Release: 3.0.3
>Organization:
>Environment:
Solaris 2.7
>Description:
Optimiser with -O2 level on seems to increment the pointer used in the source operand to early.
Sample code below (with -O2 the first character is missing):
#include <stdio.h>
void main()
{
char szBuffer[256];
char *p_cTag = szBuffer;
strcpy(szBuffer,"Testtekst");
while(*p_cTag) /* scan from start to convert to uppercase */
{
*(p_cTag++) = toupper(*p_cTag);
}
printf("Result:%s",szBuffer);
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: