This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/43222] two DEBUG i => 0 generated after loop copy header
- From: "aoliva at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jun 2010 06:28:27 -0000
- Subject: [Bug debug/43222] two DEBUG i => 0 generated after loop copy header
- References: <bug-43222-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from aoliva at gcc dot gnu dot org 2010-06-02 06:28 -------
Andrew, the debug stmts are indeed originally from the loop header's PHI nodes.
Before ch we have:
i_1 = <init>;
# i => i_1
goto <header>;
<body>:
i_3 = <whatever>(i_2);
# i => i_3
<header>:
i_2 = PHI <i_1, i_3>;
# i => i_2
if (<cond>) goto <body>; else goto <exit>;
copy_loop_header turns this into:
i_1 = <init>;
# i => i_1
<copy>:
i_4 = PHI <i_1>;
# i => i_4
if (<cond>) goto <body>; else goto <exit>;
<body>:
i_3 = <whatever>(i_2);
# i => i_3
<header>:
i_2 = PHI <i_3>;
# i => i_2
if (<cond>) goto <body>; else goto <exit>;
and that's correct. Then cfgcleanup realizes the headers can be merged with
their preds, and that kills the PHI nodes, but there's no reason why this
should kill the debug stmts.
Of course we could arrange for some cleanup passes to detect and remove debug
stmts in case they become redundant, but I don't see that we have a bug here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43222