public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/9901: optimization level -O2/3 doesn't work correctly.
@ 2003-03-02 17:02 paolo
0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2003-03-02 17:02 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, gennadi.f, nobody
Synopsis: optimization level -O2/3 doesn't work correctly.
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Sun Mar 2 17:02:41 2003
State-Changed-Why:
See c/9902.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9901
^ permalink raw reply [flat|nested] 2+ messages in thread
* c/9901: optimization level -O2/3 doesn't work correctly.
@ 2003-03-02 16:26 gennadi.f
0 siblings, 0 replies; 2+ messages in thread
From: gennadi.f @ 2003-03-02 16:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 9901
>Category: c
>Synopsis: optimization level -O2/3 doesn't work correctly.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 02 16:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: gennadi.f@corigin.com
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char *page,*p;
page=calloc(1,4);
page+=4;
p=page;
if (page) { // if we change "page" here to "1", the result will be correct
*((char **)page-1)=page; // save the address in its previous 4 bytes.
(*((char ***)page-1))++; // add 4 to the saved address.
}
page=*((char **)page-1); //"page" should be assigned to the new value.
printf("page=%08X p=%08X\n",page,p); // with the optimization level -O2/3, the value of page i
s not changed.
return 0;
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-02 17:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-02 17:02 c/9901: optimization level -O2/3 doesn't work correctly paolo
-- strict thread matches above, loose matches on Subject: below --
2003-03-02 16:26 gennadi.f
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).