This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/22591] [4.0/4.1 Regression] std::swap() followed by list::erase() produces incorrect list::begin()
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jul 2005 10:43:24 -0000
- Subject: [Bug tree-optimization/22591] [4.0/4.1 Regression] std::swap() followed by list::erase() produces incorrect list::begin()
- References: <20050721155650.22591.Simon.Finn@reify.co.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-07-26 10:43 -------
Well I'll be damned!
$ ./xgcc -B. t.c -O2 -march=nocona
$ ./a.out
Aborted
$ ./xgcc -B. t.c -O2 -march=nocona -da -fdump-tree-all
$ ./a.out
$
$ ./xgcc -B. t.c -O2 -march=nocona -S -da
$ mv t.s t.s.with_dumps
$ ./xgcc -B. t.c -O2 -march=nocona -S
$ diff -u t.s t.s.with_dumps
--- t.s 2005-07-26 12:42:14.447531418 +0200
+++ t.s.with_dumps 2005-07-26 12:42:03.501170603 +0200
@@ -26,19 +26,20 @@
.type ListSwap, @function
ListSwap:
.LFB4:
- movq (%rdi), %rcx
- testq %rcx, %rcx
+ cmpq $0, (%rdi)
je .L8
+ movq (%rdi), %rdx
movq (%rsi), %rax
movq %rax, (%rdi)
- movq %rcx, (%rsi)
+ movq %rdx, (%rsi)
movq 8(%rdi), %rdx
movq 8(%rsi), %rax
movq %rax, 8(%rdi)
movq %rdx, 8(%rsi)
+ movq (%rdi), %rdx
movq 8(%rdi), %rax
movq %rdi, (%rax)
- movq %rdi, 8(%rcx)
+ movq %rdi, 8(%rdx)
movq (%rsi), %rdx
movq 8(%rsi), %rax
movq %rsi, (%rax)
wtf?!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22591