Patchwork Fix up value_format ICE for DWARF2_ADDR_SIZE < 4 targets (PR target/55194)

login
register
mail settings
Submitter Jakub Jelinek
Date Nov. 5, 2012, 11:14 a.m.
Message ID <20121105111416.GI1881@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/197187/
State New
Headers show

Comments

Jakub Jelinek - Nov. 5, 2012, 11:14 a.m.
Hi!

Apparently some targets have DWARF2_ADDR_SIZE < 4, for dw_val_class_addr
when DW_FORM_addr can't be used value_format already handles
DWARF2_ADDR_SIZE 1, 2, 4 and 8, so I've committed this change as obvious.

2012-11-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/55194
	* dwarf2out.c (value_format) <case dw_val_class_high_pc>: Handle
	also DWARF2_ADDR_SIZE 1 and 2.


	Jakub

Patch

--- gcc/dwarf2out.c.jj	2012-10-26 21:03:45.000000000 +0200
+++ gcc/dwarf2out.c	2012-11-05 12:04:31.832255264 +0100
@@ -7597,12 +7597,16 @@  value_format (dw_attr_ref a)
     case dw_val_class_high_pc:
       switch (DWARF2_ADDR_SIZE)
 	{
-	  case 4:
-	    return DW_FORM_data4;
-	  case 8:
-	    return DW_FORM_data8;
-	  default:
-	    gcc_unreachable ();
+	case 1:
+	  return DW_FORM_data1;
+	case 2:
+	  return DW_FORM_data2;
+	case 4:
+	  return DW_FORM_data4;
+	case 8:
+	  return DW_FORM_data8;
+	default:
+	  gcc_unreachable ();
 	}
 
     default: