public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/21642] New: wrong code with -O2
@ 2005-05-18 10:02 joerg dot richter at pdv-fs dot de
2005-06-06 15:17 ` [Bug target/21642] " dje at gcc dot gnu dot org
2005-06-06 15:20 ` [Bug target/21642] [3.4 Regression] " pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: joerg dot richter at pdv-fs dot de @ 2005-05-18 10:02 UTC (permalink / raw)
To: gcc-bugs
$ gcc -v
Reading specs from /pdv/.tools/pkg/gcc/3.4.3/bin/../lib/gcc/powerpc-ibm-
aix5.2.0.0/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/tools/pkg/gcc/3.4.3 --with-
ld=/bin/ld --with-as=/bin/as --disable-threads --enable-languages=c,c++
Thread model: aix
gcc version 3.4.3
// foo.c //
#include <stdio.h>
inline void
reverse( char* beg, char* end )
{
while( beg < --end )
{
char t = *end;
*end = *beg;
*beg++ = t;
}
}
void doIt( int* val )
{
reverse( (char*)val, (char*)val + sizeof( *val ) );
}
int main()
{
int d = 0x12345678;
printf( "%x\n", d );
doIt( &d );
printf( "%x\n", d );
return 0;
}
////
$ gcc -o foo foo.c -O2
$ foo
12345678
78345612
$ gcc -o foo foo.c
$ foo
12345678
78563412
Works with GCC 3.3.3
--
Summary: wrong code with -O2
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: joerg dot richter at pdv-fs dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-ibm-aix5.2.0.0
GCC host triplet: powerpc-ibm-aix5.2.0.0
GCC target triplet: powerpc-ibm-aix5.2.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21642
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/21642] wrong code with -O2
2005-05-18 10:02 [Bug target/21642] New: wrong code with -O2 joerg dot richter at pdv-fs dot de
@ 2005-06-06 15:17 ` dje at gcc dot gnu dot org
2005-06-06 15:20 ` [Bug target/21642] [3.4 Regression] " pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: dje at gcc dot gnu dot org @ 2005-06-06 15:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dje at gcc dot gnu dot org 2005-06-06 15:17 -------
This appears to be related to strength reduction.
-O2 -fno-strength-reduce succeeds
-O1 -fstrength-reduce fails.
The bug is not present in GCC 4.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Known to fail| |3.4.3 3.4.4
Known to work| |4.0.0 4.0.1 4.1.0
Last reconfirmed|0000-00-00 00:00:00 |2005-06-06 15:17:14
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21642
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/21642] [3.4 Regression] wrong code with -O2
2005-05-18 10:02 [Bug target/21642] New: wrong code with -O2 joerg dot richter at pdv-fs dot de
2005-06-06 15:17 ` [Bug target/21642] " dje at gcc dot gnu dot org
@ 2005-06-06 15:20 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-06 15:20 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|wrong code with -O2 |[3.4 Regression] wrong code
| |with -O2
Target Milestone|--- |3.4.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21642
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-06-06 15:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18 10:02 [Bug target/21642] New: wrong code with -O2 joerg dot richter at pdv-fs dot de
2005-06-06 15:17 ` [Bug target/21642] " dje at gcc dot gnu dot org
2005-06-06 15:20 ` [Bug target/21642] [3.4 Regression] " pinskia at gcc dot gnu dot org
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).