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]

Handle more _DIV_EXPR and MOD_EXPR codes in dwarf2out.c


This fixes a bug where these codes will cause an ICE.  It may well be the
case at this point that there is some situation where a position is
"off-by-one", but there have been no cases so far.

A test case is to compile the following with -g on a system using Dwarf2.

procedure bla is
   function a_int return integer is
   begin
      return 1;
   end a_int;

   function a_string return string is
   begin
      return (1 .. 1 mod a_int => 'a');
   end a_string;

begin
   null;
end bla;



2002-07-25  Vincent Celier  <celier at gnat dot com>

        * dwarf2out.c (loc_descriptor_from_tree): Treat all *_MOD_EXPR
        and *_DIV_EXPR as TRUNC_*_EXPR.

*** gcc/dwarf2out.c	14 Apr 2003 21:12:45 -0000	1.419
--- gcc/dwarf2out.c	15 Apr 2003 18:00:07 -0000
*************** loc_descriptor_from_tree (loc, addressp)
*** 8816,8819 ****
--- 8816,8822 ----
        goto do_binop;
  
+     case FLOOR_DIV_EXPR:
+     case CEIL_DIV_EXPR:
+     case ROUND_DIV_EXPR:
      case TRUNC_DIV_EXPR:
        op = DW_OP_div;
*************** loc_descriptor_from_tree (loc, addressp)
*** 8824,8827 ****
--- 8827,8833 ----
        goto do_binop;
  
+     case FLOOR_MOD_EXPR:
+     case CEIL_MOD_EXPR:
+     case ROUND_MOD_EXPR:
      case TRUNC_MOD_EXPR:
        op = DW_OP_mod;


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