diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2009-01-09 15:19:08 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2009-01-09 15:19:08 +0000 |
commit | 67b846fa2f9093b4c342b8b581b53b2ea58fbceb (patch) | |
tree | 7a2062e174e17bddb5fc278e4a7c74f6f96a164a /gcc/config/pa | |
parent | 73f971b716256c5c37753748fa7c8ade3c49da21 (diff) | |
download | gcc-67b846fa2f9093b4c342b8b581b53b2ea58fbceb.zip gcc-67b846fa2f9093b4c342b8b581b53b2ea58fbceb.tar.gz gcc-67b846fa2f9093b4c342b8b581b53b2ea58fbceb.tar.bz2 |
pa.c (last_address): Change to unsigned.
* pa.c (last_address): Change to unsigned.
(update_total_code_bytes): Change argument to unsigned. Don't
check if insn addresses are set.
(pa_output_function_epilogue): Set last_address to UINT_MAX if insn
addresses are not set.
(pa_asm_output_mi_thunk): Handle wrap when updating last_address.
From-SVN: r143207
Diffstat (limited to 'gcc/config/pa')
-rw-r--r-- | gcc/config/pa/pa.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 960814f..44ded73 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -103,7 +103,7 @@ static void store_reg_modify (int, int, HOST_WIDE_INT); static void load_reg (int, HOST_WIDE_INT, int); static void set_reg_plus_d (int, int, HOST_WIDE_INT, int); static void pa_output_function_prologue (FILE *, HOST_WIDE_INT); -static void update_total_code_bytes (int); +static void update_total_code_bytes (unsigned int); static void pa_output_function_epilogue (FILE *, HOST_WIDE_INT); static int pa_adjust_cost (rtx, rtx, rtx, int); static int pa_adjust_priority (rtx, int); @@ -191,7 +191,7 @@ unsigned long total_code_bytes; /* The last address of the previous function plus the number of bytes in associated thunks that have been output. This is used to determine if a thunk can use an IA-relative branch to reach its target function. */ -static int last_address; +static unsigned int last_address; /* Variables to handle plabels that we discover are necessary at assembly output time. They are output after the current function. */ @@ -3986,23 +3986,18 @@ load_reg (int reg, HOST_WIDE_INT disp, int base) /* Update the total code bytes output to the text section. */ static void -update_total_code_bytes (int nbytes) +update_total_code_bytes (unsigned int nbytes) { if ((TARGET_PORTABLE_RUNTIME || !TARGET_GAS || !TARGET_SOM) && !IN_NAMED_SECTION_P (cfun->decl)) { - if (INSN_ADDRESSES_SET_P ()) - { - unsigned long old_total = total_code_bytes; + unsigned int old_total = total_code_bytes; - total_code_bytes += nbytes; + total_code_bytes += nbytes; - /* Be prepared to handle overflows. */ - if (old_total > total_code_bytes) - total_code_bytes = -1; - } - else - total_code_bytes = -1; + /* Be prepared to handle overflows. */ + if (old_total > total_code_bytes) + total_code_bytes = UINT_MAX; } } @@ -4066,6 +4061,8 @@ pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) last_address = ((last_address + FUNCTION_BOUNDARY / BITS_PER_UNIT - 1) & ~(FUNCTION_BOUNDARY / BITS_PER_UNIT - 1)); } + else + last_address = UINT_MAX; /* Finally, update the total number of code bytes output so far. */ update_total_code_bytes (last_address); @@ -7944,7 +7941,7 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta, { static unsigned int current_thunk_number; int val_14 = VAL_14_BITS_P (delta); - int nbytes = 0; + unsigned int old_last_address = last_address, nbytes = 0; char label[16]; rtx xoperands[4]; @@ -8177,6 +8174,8 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta, nbytes = ((nbytes + FUNCTION_BOUNDARY / BITS_PER_UNIT - 1) & ~(FUNCTION_BOUNDARY / BITS_PER_UNIT - 1)); last_address += nbytes; + if (old_last_address > last_address) + last_address = UINT_MAX; update_total_code_bytes (nbytes); } |