public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/6686: IA64 GCC 3.1 Incorrect run time result at -O1
@ 2003-05-03 0:23 falk.hueffner
0 siblings, 0 replies; 2+ messages in thread
From: falk.hueffner @ 2003-05-03 0:23 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jessica_han, nobody
Synopsis: IA64 GCC 3.1 Incorrect run time result at -O1
State-Changed-From-To: open->closed
State-Changed-By: falk
State-Changed-When: Sat May 3 00:23:19 2003
State-Changed-Why:
I can reproduce the bug with 3.0.4. However, with 3.2.3 it cannot
reproduce it anymore, so I close the bug.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6686
^ permalink raw reply [flat|nested] 2+ messages in thread
* optimization/6686: IA64 GCC 3.1 Incorrect run time result at -O1
@ 2002-05-16 16:36 jessica_han
0 siblings, 0 replies; 2+ messages in thread
From: jessica_han @ 2002-05-16 16:36 UTC (permalink / raw)
To: gcc-gnats
>Number: 6686
>Category: optimization
>Synopsis: IA64 GCC 3.1 Incorrect run time result at -O1
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu May 16 16:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: jessica_han@hp.com
>Release: 3.1
>Organization:
>Environment:
IA64 Linux
>Description:
Incorrect behavior at -O1
Before change, j points to: 0x80000fffffffbac0
After change, j points to: 0x6000000000000d90
Address of i (which j is supposed to equal) is: 0x6000000000000d90
value of j is: 0x80000fffffffbac0, address of i is 0x6000000000000d90
*ox.oy.j=10, expect 5
>How-To-Repeat:
g++ -O1 bug1.C
./a.out
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bug1.C"
Content-Disposition: inline; filename="bug1.C"
// failed in -O1
#include <stdio.h>
static int i = 5;
int main()
{
const class X
{
public:
mutable int i; //mutable data-member
class Y
{
public:
mutable volatile int *j; //j is a pointer to mutable volatile int
void Change_j() const
{
j = &::i;
}
};
Y oy;
X() : i(10) { }
}ox;
ox.oy.j = (volatile int*)&ox.i;
printf("Before change, j points to: %p\n",ox.oy.j);
ox.oy.Change_j();
printf("After change, j points to: %p\n",ox.oy.j);
printf("Address of i (which j is supposed to equal) is: %p\n",&i);
printf("value of j is: %p, address of i is %p\n",ox.oy.j, &i);
if(*ox.oy.j != 5)
printf("*ox.oy.j=%d, expect 5 \n", *ox.oy.j);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-05-03 0:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-03 0:23 optimization/6686: IA64 GCC 3.1 Incorrect run time result at -O1 falk.hueffner
-- strict thread matches above, loose matches on Subject: below --
2002-05-16 16:36 jessica_han
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).