This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/21964] [3.4 Regression] broken tail call at -O2 or more
- 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: 9 Jun 2005 09:22:15 -0000
- Subject: [Bug middle-end/21964] [3.4 Regression] broken tail call at -O2 or more
- References: <20050608171111.21964.ben@0x539.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-06-09 09:22 -------
In this case we obviously take the "tail_recursion" sequence, which is
already wrong:
(const_string "tail_recursion") (sequence [
(note 22 0 23 NOTE_INSN_DELETED)
(note 23 22 25 NOTE_INSN_DELETED)
(insn 25 23 26 (set (reg:SI 59)
(reg/v:SI 58 [ n ])) -1 (nil)
(nil))
(insn 26 25 24 (set (reg/v:SI 58 [ n ])
(reg:SI 59)) -1 (nil)
(nil))
(insn 24 26 28 (parallel [
(set (reg/v:SI 58 [ n ])
(plus:SI (reg/v:SI 58 [ n ])
(const_int 1 [0x1])))
(clobber (reg:CC 17 flags))
]) -1 (nil)
(nil))
(jump_insn 28 24 29 (set (pc)
(label_ref 27)) -1 (nil)
(nil))
(barrier 29 28 30)
(barrier 30 29 0)
])
Note that the "n++" (insn 24) is before the jump to the tail recursion
label at the head of the function (jump_insn 28).
So the initial RTL generation is wrong.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21964