This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
- From: "amylaar at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jul 2010 22:54:22 -0000
- Subject: [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
- References: <bug-44921-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from amylaar at gcc dot gnu dot org 2010-07-12 22:54 -------
(In reply to comment #1)
> This patch:
>
> Index: postreload.c
> ===================================================================
> --- postreload.c (revision 162085)
> +++ postreload.c (working copy)
> @@ -1281,7 +1281,7 @@ move2add_use_add3_insn (rtx reg, rtx sym
> rtx src = SET_SRC (pat);
> int regno = REGNO (reg);
> int min_cost = INT_MAX;
> - int min_regno;
> + int min_regno = -1;
> bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
> int i;
>
> @@ -1317,7 +1317,7 @@ move2add_use_add3_insn (rtx reg, rtx sym
> }
> }
>
> - if (min_cost < rtx_cost (src, SET, speed))
> + if (min_regno >= 0 && min_cost < rtx_cost (src, SET, speed))
> {
> rtx tem;
>
> works for me.
The variable can not actually be used uninitalized, since min_cost is
initalized to INT_MAX, and the return type of rtx_cost is int.
So it is enough to shut up the compiler warning, no need to add an
extra test there. I.e. the first hunk should be sufficient.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44921