Fix PR49154-related SEGV in IRA. And ping.

Hans-Peter Nilsson hp@bitrange.com
Fri Jun 10 01:59:00 GMT 2011


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.

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;

brgds, H-P


More information about the Gcc-patches mailing list