public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/2918: long long assignment lost
@ 2002-04-02 0:52 rth
0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-04-02 0:52 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, pauli
Synopsis: long long assignment lost
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Tue Apr 2 00:52:41 2002
State-Changed-Why:
Fixed for gcc 3.1.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2918
^ permalink raw reply [flat|nested] 2+ messages in thread
* optimization/2918: long long assignment lost
@ 2001-05-23 20:06 pauli
0 siblings, 0 replies; 2+ messages in thread
From: pauli @ 2001-05-23 20:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 2918
>Category: optimization
>Synopsis: long long assignment lost
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed May 23 20:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Paul Dale
>Release: gcc version 2.95.3 20010315 (release)
>Organization:
>Environment:
Linux skaro 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
x86 platform cross compiling to coldfire
>Description:
When the attached C file is built using:
$ m68k-elf-gcc -m5200 -O1 -save-temps pauli.c -c
or
$ m68k-elf-gcc -m5200 -O2 -save-temps pauli.c -c
incorrect code is generated. Specifically, the second assignment
in the function body is discarded. Compiling with -O0
generates correct code.
>How-To-Repeat:
struct c {
unsigned long long a, b;
};
void x(unsigned long *p, struct c *d)
{
d->b = d->a;
d->a = *p;
}
>Fix:
Declaring a volatile unsigned long temporary variable and
storing *p into here and then this variable in d->a
circumvents the problem.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-02 8:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-02 0:52 optimization/2918: long long assignment lost rth
-- strict thread matches above, loose matches on Subject: below --
2001-05-23 20:06 pauli
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).