Fix PR49154-related SEGV in IRA. And ping.
diff mbox

Message ID alpine.BSF.2.00.1106092105220.61896@dair.pair.com
State New
Headers show

Commit Message

Hans-Peter Nilsson June 10, 2011, 1:10 a.m. UTC
On Thu, 9 Jun 2011, H.J. Lu wrote:
> >        PR rtl-optimization/49154
> >        * ira-costs.c (setup_regno_cost_classes_by_mode): If there
> >        already is a matching slot in the hashtable, assign it to
> >        classes_ptr.
> >
>
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49354

Fixed.  Cross-builds apparently don't include -Werror, meh.
Tested by observing warning without, no warning with, committed
as obvious.  Thanks for keeping me honest.  I'm just going to
rant a little and say it's weird that we have to cast a "void *"
to another pointer type, but such is C++ or whatever we're
writing now.

	PR bootstrap/49354
	* ira-costs.c (setup_regno_cost_classes_by_mode): Add missing cast
	to last assignment.


brgds, H-P

Patch
diff mbox

Index: ira-costs.c
===================================================================
--- ira-costs.c	(revision 174868)
+++ ira-costs.c	(working copy)
@@ -300,7 +300,7 @@  setup_regno_cost_classes_by_mode (int re
 	  *slot = classes_ptr;
 	}
       else
-	classes_ptr = *slot;
+	classes_ptr = (cost_classes_t) *slot;
       cost_classes_mode_cache[mode] = (cost_classes_t) *slot;
     }
   regno_cost_classes[regno] = classes_ptr;