* hist.c (scale_and_align_entries): Don't use DEFUN_VOID. Do UNITS_TO_CODE
authorKen Raeburn <raeburn@cygnus>
Tue, 21 Nov 1995 19:10:18 +0000 (19:10 +0000)
committerKen Raeburn <raeburn@cygnus>
Tue, 21 Nov 1995 19:10:18 +0000 (19:10 +0000)
adjustment unconditionally; compiler can optimize away zero-offset case.  Refer
to scaled_addr, not aligned_addr.

gprof/ChangeLog
gprof/hist.c

index fa1d8aa1b7965716f4fbe134babc597df8d8dab6..3e180b742f18efbc62b2a13f89678b0b17ff799a 100644 (file)
@@ -1,5 +1,9 @@
 Tue Nov 21 13:24:39 1995  Ken Raeburn  <raeburn@cygnus.com>
 
+       * hist.c (scale_and_align_entries): Don't use DEFUN_VOID.  Do
+       UNITS_TO_CODE adjustment unconditionally; compiler can optimize
+       away zero-offset case.  Refer to scaled_addr, not aligned_addr.
+
        * vax.c: Don't include vax.h here.
 
 Thu Nov 16 03:41:37 1995  Ken Raeburn  <raeburn@cygnus.com>
index 69cc3ea004ab5558ebd180bfdd5151498de7e6a5..76dfe948a7c57af21b4e3118984636f6451be522 100644 (file)
@@ -210,28 +210,24 @@ DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename)
  * next bin.
  */
 static void
-DEFUN_VOID (scale_and_align_entries)
+scale_and_align_entries ()
 {
   Sym *sym;
-#if OFFSET_TO_CODE > 0
   bfd_vma bin_of_entry;
   bfd_vma bin_of_code;
-#endif
 
   for (sym = symtab.base; sym < symtab.limit; sym++)
     {
       sym->hist.scaled_addr = sym->addr / sizeof (UNIT);
-#if OFFSET_TO_CODE > 0
       bin_of_entry = (sym->hist.scaled_addr - lowpc) / hist_scale;
       bin_of_code = (sym->hist.scaled_addr + UNITS_TO_CODE - lowpc) / hist_scale;
       if (bin_of_entry < bin_of_code)
        {
          DBG (SAMPLEDEBUG,
               printf ("[scale_and_align_entries] pushing 0x%lx to 0x%lx\n",
-                sym->hist.scaled_addr, sym->aligned_addr + UNITS_TO_CODE));
-         sym->aligned_addr += UNITS_TO_CODE;
+                sym->hist.scaled_addr, sym->scaled_addr + UNITS_TO_CODE));
+         sym->scaled_addr += UNITS_TO_CODE;
        }
-#endif /* OFFSET_TO_CODE > 0 */
     }
 }