This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20479] New: Instruction scheduler falsely reorders insns (ia64)
- From: "grigory dot zagorodnev at intel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2005 08:19:27 -0000
- Subject: [Bug middle-end/20479] New: Instruction scheduler falsely reorders insns (ia64)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Test listed below fails when compiled with -02 optimization at IA64. It appears
that instruction scheduler misses dependency between two assignments in
the 'set_code' routine and falsely reorders them.
$ cat test.c
typedef struct s_t {
short a;
short b;
} *ps;
void set_code (ps obj, short code) {
*((int *) obj) = 0;
obj->a = code;
}
int printf(const char *, ...);
int main() {
struct s_t obj;
set_code(&obj, 123);
printf("%s: got %d, expected 123\n",
((obj.a == 123)?"PASS":"FAIL"), obj.a);
}
$ gcc test.c -O2
$ ./a.out
FAIL: got 0, expected 123
Here is the assembly code of function 'set_code' with incorrectly reordered
instructions.
$ gcc test.c -S -O2
.proc set_code#
set_code:
.prologue
.body
st2 [r32] = r33 ; obj->a = code;
st4 [r32] = r0 ; *((int *) obj) = 0;
br.ret.sptk.many b0
PS: the minimal set of optimizations reproducing the failure is "-O1 -fstrict-
aliasing -fschedule-insns".
--
Summary: Instruction scheduler falsely reorders insns (ia64)
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: grigory dot zagorodnev at intel dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: ia64-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20479