+2001-07-16 Andreas Jaeger <aj@suse.de>
+
+ * gcov.c (output_data): Use HOST_WIDEST_INT_PRINT_DEC to output
+ variables of type HOST_WIDEST_INT.
+
+ * libgcc2.c (__bb_exit_func): Handle gcov_type as long long.
+ (__bb_exit_func): Correct type of count_max to avoid overflow.
+ (num_digits): Handle long long argument.
+
+ * combine.c (gen_lowpart_for_combine): Remove unused variable.
+
2001-07-16 Neil Booth <neil@cat.daikokuya.demon.co.uk>
* output.h (sdb_begin_function_line): Restore as an extern
2001-07-13 Hartmut Penner <hpenner@de.ibm.com>
- * config.gcc: Add configuration for s/390.
- * config/s390/s390.c: New. Subroutines for code generation.
+ * config.gcc: Add configuration for s/390.
+ * config/s390/s390.c: New. Subroutines for code generation.
* config/s390/s390.h: New. Definitions for s/390.
* config/s390/s390-protos.h: New. Prototypes.
* config/s390/linux.h: New. Definitions for linux for s/390.
* config/s390/linux64.h: New. Definitions for linux for zSeries.
- * config/s390/t-linux: New. Makefile fragment.
- * config/s390/s390.md: New. Machine description for s/390 and zSeries.
+ * config/s390/t-linux: New. Makefile fragment.
+ * config/s390/s390.md: New. Machine description for s/390 and zSeries.
* config/s390/fixdfdi.h: New. Fix L_fix*di.
-
+
Fri Jul 13 14:46:21 CEST 2001 Jan Hubicka <jh@suse.cz>
* emit-rtl.c (try_split): Update mark_jump_label call.
* jump.c (rtx_renumbered_equal_p): Handle 't' fields.
* output.h (cleanup_cfg): Update prototype.
* reg-stack.c (reg_to_stack): Use cleanup_cfg instead of jump_optimize
- * sibcall.c (optimize_sibling_and_tail_recursive_call): Update
+ * sibcall.c (optimize_sibling_and_tail_recursive_call): Update
cleanup_cfg call; kill missleading comment.
* toplev.c (rest_of_compilation): Update all cleanup_cfg calls.
* flow.c (merge_blocks, try_optimize_cfg, cleanup_cfg): Accept mode
2001-07-11 Mark Mitchell <mark@codesourcery.com>
- * stmt.c (parse_output_constraint): New function, split out
+ * stmt.c (parse_output_constraint): New function, split out
from ...
(expand_asm_operands): ... here. Use parse_output_constraint.
* tree.h (parse_output_constraint): Declare it.
* recog.c (offsettable_address_p): Handle LO_SUM case.
* config/mips/mips.c (double_memory_operand): Use adjust_address_nv
instead of plus_constant.
-
+
2001-07-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* reload1.c (merge_assigned_reloads): After a RELOAD_OTHER merge,
.loc support.
* collect2.c (main): Set COLLECT_NO_DEMANGLE for subprocesses.
- (dump_file): Only pad the demangled name with spaces if the
+ (dump_file): Only pad the demangled name with spaces if the
mangled name was padded with spaces.
2001-07-10 Bernd Schmidt <bernds@redhat.com>
for (p = NEXT_INSN (insn); p != i3; p = NEXT_INSN (p))
if (INSN_P (p) && p != succ && volatile_refs_p (PATTERN (p)))
- return 0;
+ return 0;
}
/* If INSN is an asm, and DEST is a hard register, reject, since it has
This is NOT equivalent to:
(parallel [(set (subreg:SI (reg:DI 100) 0) <foo>)
- (set (reg:DI 101) (reg:DI 100))])
+ (set (reg:DI 101) (reg:DI 100))])
Not only does this modify 100 (in which case it might still be valid
if 100 were dead in I2), it sets 101 to the ORIGINAL value of 100.
{
rtx set;
rtx src, dest;
-
+
/* If this isn't really an insn, we can't do anything.
This can occur when flow deletes an insn that it has merged into an
auto-increment address. */
/* If I3 has an inc, then give up if I1 or I2 uses the reg that is inc'd.
We used to do this EXCEPT in one case: I3 has a post-inc in an
output operand. However, that exception can give rise to insns like
- mov r3,(r3)+
+ mov r3,(r3)+
which is a famous insn on the PDP-11 where the value of r3 used as the
source was model-dependent. Avoid this sort of thing. */
insn_code_number = recog_for_combine (&m_split, i3, &new_i3_notes);
if (insn_code_number >= 0)
newpat = m_split;
- }
+ }
else if (m_split && GET_CODE (m_split) == SEQUENCE
&& XVECLEN (m_split, 0) == 2
&& (next_real_insn (i2) == i3
{
rtx temp;
temp = simplify_subreg (mode, SUBREG_REG (x), op0_mode,
- SUBREG_BYTE (x));
+ SUBREG_BYTE (x));
if (temp)
return temp;
}
return gen_rtx_GE (mode, XEXP (XEXP (x, 0), 0), const0_rtx);
/* Apply De Morgan's laws to reduce number of patterns for machines
- with negating logical insns (and-not, nand, etc.). If result has
- only one NOT, put it first, since that is how the patterns are
- coded. */
+ with negating logical insns (and-not, nand, etc.). If result has
+ only one NOT, put it first, since that is how the patterns are
+ coded. */
if (GET_CODE (XEXP (x, 0)) == IOR || GET_CODE (XEXP (x, 0)) == AND)
- {
+ {
rtx in1 = XEXP (XEXP (x, 0), 0), in2 = XEXP (XEXP (x, 0), 1);
enum machine_mode op_mode;
temp = expand_compound_operation (XEXP (x, 0));
/* For C equal to the width of MODE minus 1, (neg (ashiftrt X C)) can be
- replaced by (lshiftrt X C). This will convert
+ replaced by (lshiftrt X C). This will convert
(neg (sign_extract X 1 Y)) to (zero_extract X 1 Y). */
if (GET_CODE (temp) == ASHIFTRT
&& num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
>= GET_MODE_BITSIZE (mode) + 1
&& ! (GET_CODE (XEXP (x, 0)) == LSHIFTRT
- && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT))
+ && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT))
return gen_lowpart_for_combine (mode, XEXP (x, 0));
/* A truncate of a comparison can be replaced with a subreg if
case GT: case GTU: case GE: case GEU:
case LT: case LTU: case LE: case LEU:
case UNEQ: case LTGT:
- case UNGT: case UNGE:
- case UNLT: case UNLE:
+ case UNGT: case UNGE:
+ case UNLT: case UNLE:
case UNORDERED: case ORDERED:
/* If the first operand is a condition code, we can't do anything
with it. */
}
break;
-
+
default:
break;
}
&& GET_RTX_CLASS (GET_CODE (XEXP (XEXP (x, 0), 0))) == '<'
&& (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))
<= HOST_BITS_PER_WIDE_INT)
- && ((HOST_WIDE_INT) STORE_FLAG_VALUE
+ && ((HOST_WIDE_INT) STORE_FLAG_VALUE
& ~GET_MODE_MASK (GET_MODE (XEXP (x, 0)))) == 0)
return XEXP (XEXP (x, 0), 0);
new = gen_rtx_SUBREG (tmode, inner, final_word);
}
- else
- new = inner;
- }
+ else
+ new = inner;
+ }
else
new = force_to_mode (inner, tmode,
len >= HOST_BITS_PER_WIDE_INT
/* Do not reverse the condition when it is NE or EQ.
This is because we cannot conclude anything about
the value of 'SMAX (x, y)' when x is not equal to y,
- but we can when x equals y. */
+ but we can when x equals y. */
if ((code == SMAX || code == UMAX)
&& ! (cond == EQ || cond == NE))
cond = reverse_condition (cond);
if (GET_CODE (x) == MEM)
{
register int offset = 0;
- rtx new;
/* Refuse to work on a volatile memory ref or one with a mode-dependent
address. */
new_code = GET_CODE (op0);
else
new_code = combine_reversed_comparison_code (op0);
-
+
if (new_code != UNKNOWN)
{
code = new_code;
/* Gcov.c: prepend line execution counts and branch probabilities to a
source file.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by James E. Wilson of Cygnus Support.
Mangled by Bob Manson of Cygnus Support.
/* Output the number of times a branch was taken as opposed to the percentage
of times it was taken. Turned on by the -c option */
-
+
static int output_branch_counts = 0;
/* Forward declarations. */
fnotice (stderr, "Could not open data file %s.\n", da_file_name);
fnotice (stderr, "Assuming that all execution counts are zero.\n");
}
-
+
bbg_file = fopen (bbg_file_name, "rb");
if (bbg_file == NULL)
{
bb_graph[arcptr->target].pred_count--;
}
}
-
+
static void
solve_program_flow_graph (bptr)
struct bb_info_list *bptr;
}
}
}
-
+
/* If the graph has been correctly solved, every block will have a
succ and pred count of zero. */
for (i = 0; i < num_blocks; i++)
bb_data = (char *) xmalloc ((unsigned) buf.st_size);
fread (bb_data, sizeof (char), buf.st_size, bb_file);
-
+
fclose (bb_file);
if (da_file)
fclose (da_file);
if (arcptr->fall_through)
continue;
-
+
a_ptr = (struct arcdata *) xmalloc (sizeof (struct arcdata));
a_ptr->total = total;
if (total == 0)
if (output_branch_probs)
branch_probs = (struct arcdata **)
xcalloc (sizeof (struct arcdata *), s_ptr->maxlineno);
-
+
/* There will be a zero at the beginning of the bb info, before the
first list of line numbers, so must initialize block_num to 0. */
block_num = 0;
this_file = 0;
else
this_file = 1;
-
+
/* Scan past the file name. */
do {
count++;
function_name);
abort ();
}
-
+
if (output_branch_probs && this_file)
calculate_branch_probs (current_graph, block_num,
branch_probs, last_line_num);
/* Now the statistics are ready. Read in the source file one line
at a time, and output that line to the gcov file preceded by
its execution count if non zero. */
-
+
source_file = fopen (source_file_name, "r");
if (source_file == NULL)
{
if (output_long_names && strcmp (cptr, input_file_name))
{
gcov_file_name = xmalloc (count + 7 + strlen (input_file_name));
-
+
cptr = strrchr (input_file_name, '/');
if (cptr)
strcpy (gcov_file_name, cptr + 1);
{
if (output_branch_counts)
fnotice (gcov_file,
- "call %d returns = %d\n",
+ "call %d returns = "
+ HOST_WIDEST_INT_PRINT_DEC "\n",
i, a_ptr->total - a_ptr->hits);
else
fnotice (gcov_file,
- "call %d returns = %d%%\n",
+ "call %d returns = "
+ HOST_WIDEST_INT_PRINT_DEC "%%\n",
i, 100 - ((a_ptr->hits * 100) +
(a_ptr->total >> 1))/a_ptr->total);
}
{
if (output_branch_counts)
fnotice (gcov_file,
- "branch %d taken = %d\n",
+ "branch %d taken = "
+ HOST_WIDEST_INT_PRINT_DEC "\n",
i, a_ptr->hits);
else
fnotice (gcov_file,
- "branch %d taken = %d%%\n", i,
+ "branch %d taken = "
+ HOST_WIDEST_INT_PRINT_DEC "%%\n", i,
((a_ptr->hits * 100) +
(a_ptr->total >> 1))/
a_ptr->total);
abort ();
return w;
-}
+}
#endif
\f
#ifdef L_addvdi3
/* Define codes for all the float formats that we know of. Note
that this is copied from real.h. */
-
+
#define UNKNOWN_FLOAT_FORMAT 0
#define IEEE_FLOAT_FORMAT 1
#define VAX_FLOAT_FORMAT 2
static struct bb *bb_head;
-static int num_digits (long value, int base) __attribute__ ((const));
+static int num_digits (long long value, int base) __attribute__ ((const));
/* Return the number of digits needed to print a value */
-/* __inline__ */ static int num_digits (long value, int base)
+/* __inline__ */ static int num_digits (long long value, int base)
{
int minus = (value < 0 && base != 16);
- unsigned long v = (minus) ? -value : value;
+ unsigned long long v = (minus) ? -value : value;
int ret = minus;
do
else
{
long n_counts = 0;
-
+
if (ungetc (firstchar, da_file) == EOF)
rewind (da_file);
if (__read_long (&n_counts, da_file, 8) != 0)
if (__write_gcov_type (ptr->ncounts, da_file, 8) != 0)
{
-
+
fprintf (stderr, "arc profiling: Error writing output file %s.\n",
ptr->filename);
}
fprintf (stderr, "arc profiling: Error writing output file %s.\n",
ptr->filename);
}
-
+
if (fclose (da_file) == EOF)
fprintf (stderr, "arc profiling: Error closing output file %s.\n",
ptr->filename);
int file_p = (func_p && ptr->filenames);
int addr_p = (ptr->addresses != 0);
long ncounts = ptr->ncounts;
- long cnt_max = 0;
+ gcov_type cnt_max = 0;
long line_max = 0;
long addr_max = 0;
int file_len = 0;
/* Now print out the basic block information. */
for (i = 0; i < ncounts; i++)
{
+#if LONG_TYPE_SIZE == GCOV_TYPE_SIZE
fprintf (file,
" Block #%*d: executed %*ld time(s)",
blk_len, i+1,
cnt_len, ptr->counts[i]);
+#else
+ fprintf (file,
+ " Block #%*d: executed %*lld time(s)",
+ blk_len, i+1,
+ cnt_len, ptr->counts[i]);
+#endif
if (addr_p)
fprintf (file, " address= 0x%.*lx", addr_len,
struct bb *blocks;
} __bb;
-/* Vars to store addrs of source and destination basic blocks
+/* Vars to store addrs of source and destination basic blocks
of a jump. */
static unsigned long bb_src = 0;
if (mode[1])
return (FILE *) 0;
- if (mode[0] != 'r' && mode[0] != 'w')
+ if (mode[0] != 'r' && mode[0] != 'w')
return (FILE *) 0;
p = fn + strlen (fn)-1;
FILE *file = fopen ("bb.out", "a");
struct bb_func *f;
struct bb *b;
-
+
if (!file)
perror ("bb.out");
goto found;
}
}
-
+
if (!printed_something)
{
fprintf (file, "Functions in `bb.in' not executed during basic block profiling on %s\n", ctime ((void *) &time_value));
if (p->filename)
fprintf (file, " of file %s", p->filename);
fprintf (file, "\n" );
-
+
found: ;
}
}
return;
}
-
+
else if (file)
{
long time_value;
unsigned long cnt_max = 0;
int cnt_len;
int addr_len;
-
+
/* This is somewhat type incorrect, but it avoids worrying about
exactly where time.h is included from. It should be ok unless
a void * differs from other pointer formats, or if sizeof (long)
is < sizeof (time_t). It would be nice if we could assume the
use of rationale standards here. */
-
+
time ((void *) &time_value);
fprintf (file, "Basic block jump tracing");
}
fprintf (file, " finished on %s\n", ctime ((void *) &time_value));
-
+
for (i = 0; i < BB_BUCKETS; i++)
{
struct bb_edge *bucket = bb_hashbuckets[i];
for ( ; bucket; bucket = bucket->next )
{
- if (addr_max < bucket->src_addr)
+ if (addr_max < bucket->src_addr)
addr_max = bucket->src_addr;
- if (addr_max < bucket->dst_addr)
+ if (addr_max < bucket->dst_addr)
addr_max = bucket->dst_addr;
- if (cnt_max < bucket->count)
+ if (cnt_max < bucket->count)
cnt_max = bucket->count;
}
}
addr_len = num_digits (addr_max, 16);
cnt_len = num_digits (cnt_max, 10);
-
+
for ( i = 0; i < BB_BUCKETS; i++)
{
struct bb_edge *bucket = bb_hashbuckets[i];
for ( ; bucket; bucket = bucket->next )
{
fprintf (file,
- "Jump from block 0x%.*lx to block 0x%.*lx executed %*lu time(s)\n",
- addr_len, bucket->src_addr,
- addr_len, bucket->dst_addr,
+ "Jump from block 0x%.*lx to block 0x%.*lx executed %*lu time(s)\n",
+ addr_len, bucket->src_addr,
+ addr_len, bucket->dst_addr,
cnt_len, bucket->count);
}
}
-
+
fprintf (file, "\n");
}
buf[i--] = '\0';
p = buf;
- if (*p == '-')
- {
- m = TRACE_OFF;
- p++;
+ if (*p == '-')
+ {
+ m = TRACE_OFF;
+ p++;
}
- else
- {
- m = TRACE_ON;
+ else
+ {
+ m = TRACE_ON;
}
if (!strcmp (p, "__bb_trace__"))
bb_mode |= 1;
bb_mode |= 4;
else if (!strcmp (p, "__bb_showret__"))
bb_mode |= 8;
- else
+ else
{
struct bb_func *f = (struct bb_func *) malloc (sizeof (struct bb_func));
if (f)
}
fclose (file);
-#ifdef HAVE_POPEN
+#ifdef HAVE_POPEN
if (bb_mode & 1)
bb_tracefile = gopen ("bbtrace.gz", "w");
if (bb_mode & 2)
{
- bb_hashbuckets = (struct bb_edge **)
+ bb_hashbuckets = (struct bb_edge **)
malloc (BB_BUCKETS * sizeof (struct bb_edge *));
if (bb_hashbuckets)
/* Use a loop here rather than calling bzero to avoid having to
= & bb_hashbuckets[ (((int) bb_src*8) ^ (int) bb_dst) % BB_BUCKETS ];
bucket = *startbucket;
- for (bucket = *startbucket; bucket;
+ for (bucket = *startbucket; bucket;
oldnext = &(bucket->next), bucket = *oldnext)
{
if (bucket->src_addr == bb_src
= & bb_hashbuckets[ (((int) bb_dst * 8) ^ (int) bb_src) % BB_BUCKETS ];
bucket = *startbucket;
- for (bucket = *startbucket; bucket;
+ for (bucket = *startbucket; bucket;
oldnext = &(bucket->next), bucket = *oldnext)
{
if (bucket->src_addr == bb_dst
MACHINE_STATE_SAVE("3")
if (!blocks->zero_word)
- {
+ {
if (!trace_init)
- {
+ {
trace_init = 1;
__bb_init_prg ();
}
__clear_cache (char *beg __attribute__((__unused__)),
char *end __attribute__((__unused__)))
{
-#ifdef CLEAR_INSN_CACHE
+#ifdef CLEAR_INSN_CACHE
CLEAR_INSN_CACHE (beg, end);
#else
#ifdef INSN_CACHE_SIZE
/* Compute the cache alignment of the place to stop clearing. */
#if 0 /* This is not needed for gcc's purposes. */
/* If the block to clear is bigger than a cache plane,
- we clear the entire cache, and OFFSET is already correct. */
+ we clear the entire cache, and OFFSET is already correct. */
if (end < beg + INSN_CACHE_PLANE_SIZE)
#endif
offset = (((int) (end + INSN_CACHE_LINE_WIDTH - 1)
#endif /* WINNT && ! __CYGWIN__ && ! _UWIN */
-#ifdef TRANSFER_FROM_TRAMPOLINE
-TRANSFER_FROM_TRAMPOLINE
+#ifdef TRANSFER_FROM_TRAMPOLINE
+TRANSFER_FROM_TRAMPOLINE
#endif
#if defined (NeXT) && defined (__MACH__)
#else
__clear_cache ((int) addr, (int) eaddr);
#endif
-}
+}
#endif /* defined (NeXT) && defined (__MACH__) */
int save_errno;
static unsigned long lowest = USRSTACK;
unsigned long current = (unsigned long) &save_errno & -NBPC;
-
+
/* Ignore errno being set. memctl sets errno to EINVAL whenever the
address is seen as 'negative'. That is the case with the stack. */
errno changing without explicitly calling any system-call. */
save_errno = errno;
- /* Keep it simple : memctl (MCT_TEXT) always fully clears the insn cache.
+ /* Keep it simple : memctl (MCT_TEXT) always fully clears the insn cache.
No need to use an address derived from _start or %sp, as 0 works also. */
memctl(0, 4096, MCT_TEXT);
errno = save_errno;
extern void _cleanup (void);
extern void _exit (int) __attribute__ ((__noreturn__));
-void
+void
exit (int status)
{
if (atexit_chain)