This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add CONSTRUCTOR case to loc_descriptor_from_tree in dwarf2out.c


The following Ada test case produces a CONSTRUCTOR at that function.
Lightly tested since it only does something in a case that used to abort.

package Toto is

  type Sensor_Side_Type is ( Left, Right);

  type Input_ID_Type is (L_Press_Alt, L_Baro_Alt_2, R_Press_Alt, R_Baro_Alt_2);

  type Strike_Counter_Type is range 0..2**15-1;

  type Word_Strike_Counter_Array_Type is array(Input_ID_Type range <>) of Strike_Counter_Type;

  procedure Check_Sensor (Side  : in Sensor_Side_Type);

end Toto ;
package body Toto is
  procedure Check_Sensor (Side  : in Sensor_Side_Type) is

  Input_First : constant array(Sensor_Side_Type) of Input_Id_Type :=
     (Left => L_Press_Alt, Right=> R_Press_Alt);

  Input_Last : constant array(Sensor_Side_Type) of Input_Id_Type :=
     (Left => L_Baro_Alt_2, Right=> R_Baro_Alt_2);

  Local_Rate_Error_Counts : Word_Strike_Counter_Array_Type
                              (Input_First(Side) .. Input_Last(Side))
     := (others => 0);
  begin
     null;
  end Check_Sensor;
end Toto;

Thu Jul 31 17:30:50 2003  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* dwarf2out.c (loc_descriptor_from_tree, case CONSTRUCTOR): New case.

*** gcc/dwarf2out.c.jul31	Thu Jul 31 17:16:37 2003
--- gcc/dwarf2out.c	Thu Jul 31 17:21:21 2003
*************** loc_descriptor_from_tree (loc, addressp)
*** 8196,8199 ****
--- 8196,8219 ----
        break;
  
+     case CONSTRUCTOR:
+       {
+ 	/* If this is already in memory and at a constant address, we can
+ 	   support it.  */
+ 	rtx rtl = TREE_CST_RTL (loc);
+ 
+ #ifdef ASM_SIMPLIFY_DWARF_ADDR
+ 	if (rtl)
+ 	  rtl = ASM_SIMPLIFY_DWARF_ADDR (rtl);
+ #endif
+ 
+ 	if (rtl == NULL_RTX ||  GET_CODE (rtl) != MEM
+ 	    || !CONSTANT_P (XEXP (rtl, 0)))
+ 	  return 0;
+ 
+ 	indirect_p = 1;
+ 	ret = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (rtl));
+ 	break;
+       }
+ 
      case TRUTH_AND_EXPR: 
      case TRUTH_ANDIF_EXPR:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]