aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse-common.cc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
commit071b4126c613881f4cb25b4e5c39032964827f88 (patch)
tree7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/gcse-common.cc
parent845d23f3ea08ba873197c275a8857eee7edad996 (diff)
parentcaa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff)
downloadgcc-devel/gfortran-test.zip
gcc-devel/gfortran-test.tar.gz
gcc-devel/gfortran-test.tar.bz2
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/gcse-common.cc')
-rw-r--r--gcc/gcse-common.cc40
1 files changed, 32 insertions, 8 deletions
diff --git a/gcc/gcse-common.cc b/gcc/gcse-common.cc
index 888e4d6..9ce9bb5 100644
--- a/gcc/gcse-common.cc
+++ b/gcc/gcse-common.cc
@@ -27,7 +27,8 @@
#include "rtl.h"
#include "df.h"
#include "gcse-common.h"
-
+#include "regs.h"
+#include "function-abi.h"
/* Record all of the canonicalized MEMs of record_last_mem_set_info's insn.
Note we store a pair of elements in the list, so they have to be
@@ -129,13 +130,36 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap,
switch (code)
{
case REG:
- {
- df_ref def;
- for (def = DF_REG_DEF_CHAIN (REGNO (x));
- def;
- def = DF_REF_NEXT_REG (def))
- bitmap_clear_bit (bmap[DF_REF_BB (def)->index], indx);
- }
+ {
+ df_ref def;
+ for (def = DF_REG_DEF_CHAIN (REGNO (x));
+ def;
+ def = DF_REF_NEXT_REG (def))
+ bitmap_clear_bit (bmap[DF_REF_BB (def)->index], indx);
+
+ /* Check for hard registers that are partially clobbered (but not
+ fully clobbered) by calls. Such partial clobbers do not have
+ an associated definition or use in the DF representation,
+ but they do prevent the register from being transparent.
+
+ ??? The check here is fairly crude. We could instead maintain
+ separate blocks_with_calls bitmaps for each ABI. */
+ if (HARD_REGISTER_P (x))
+ for (unsigned int i = 0; i < NUM_ABI_IDS; ++i)
+ {
+ const predefined_function_abi &abi = function_abis[i];
+ if (abi.initialized_p ()
+ && overlaps_hard_reg_set_p (abi.only_partial_reg_clobbers (),
+ GET_MODE (x), REGNO (x)))
+ {
+ bitmap_iterator bi;
+ unsigned bb_index;
+ EXECUTE_IF_SET_IN_BITMAP (blocks_with_calls, 0, bb_index, bi)
+ bitmap_clear_bit (bmap[bb_index], indx);
+ break;
+ }
+ }
+ }
return;