expand_builtin_dwarf_reg_size

John Carr jfc@mit.edu
Wed Sep 23 15:55:00 GMT 1998


I ran across the same bug (also modifying the i386 machine
description).  Here is my fix.

*** dwarf2out.c	1998/09/10 10:45:57	1.68
--- dwarf2out.c	1998/09/23 22:51:23
*************** expand_builtin_dwarf_reg_size (reg_tree,
*** 642,665 ****
      }
    else
      {
        --n_ranges;
        t = build_int_2 (ranges[n_ranges].size, 0);
!       size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
!       for (; n_ranges--; )
  	{
! 	  if ((DWARF_FRAME_REGNUM (ranges[n_ranges].end)
! 	       - DWARF_FRAME_REGNUM (ranges[n_ranges].beg))
! 	      != ranges[n_ranges].end - ranges[n_ranges].beg)
  	    abort ();
! 	  if (DWARF_FRAME_REGNUM (ranges[n_ranges].beg) >= size)
  	    abort ();
- 	  size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
  	  t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
! 			    build_int_2 (DWARF_FRAME_REGNUM
! 					 (ranges[n_ranges].end), 0)));
  	  t = fold (build (COND_EXPR, integer_type_node, t2,
  			   build_int_2 (ranges[n_ranges].size, 0), t));
  	}
      }
    return expand_expr (t, target, Pmode, 0);
  }
--- 642,667 ----
      }
    else
      {
+       int last_end = 100;
        --n_ranges;
        t = build_int_2 (ranges[n_ranges].size, 0);
!       do
  	{
! 	  int beg = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
! 	  int end = DWARF_FRAME_REGNUM (ranges[n_ranges].end);
! 	  if (beg < 0)
! 	    continue;
! 	  if (end >= last_end)
  	    abort ();
! 	  last_end = end;
! 	  if (end - beg != ranges[n_ranges].end - ranges[n_ranges].beg)
  	    abort ();
  	  t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
! 			    build_int_2 (end, 0)));
  	  t = fold (build (COND_EXPR, integer_type_node, t2,
  			   build_int_2 (ranges[n_ranges].size, 0), t));
  	}
+       while (--n_ranges > 0);
      }
    return expand_expr (t, target, Pmode, 0);
  }



More information about the Gcc mailing list