aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-lives.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2017-10-16 20:34:53 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2017-10-16 20:34:53 +0000
commit2de3d3c6a62ac4299e9f5a310e4bf8ff28dbd47f (patch)
treed2982e904ae5477184e730c0645f8001df5fdce5 /gcc/lra-lives.c
parent55015c109a09c6f5f1fa76bef388628ee895eedb (diff)
downloadgcc-2de3d3c6a62ac4299e9f5a310e4bf8ff28dbd47f.zip
gcc-2de3d3c6a62ac4299e9f5a310e4bf8ff28dbd47f.tar.gz
gcc-2de3d3c6a62ac4299e9f5a310e4bf8ff28dbd47f.tar.bz2
re PR sanitizer/82353 (runtime ubsan crash)
2017-10-16 Vladimir Makarov <vmakarov@redhat.com> PR sanitizer/82353 * lra.c (collect_non_operand_hard_regs): Don't ignore operator locations. * lra-lives.c (bb_killed_pseudos, bb_gen_pseudos): Move up. (make_hard_regno_born, make_hard_regno_dead): Update bb_killed_pseudos and bb_gen_pseudos for fixed regs. From-SVN: r253796
Diffstat (limited to 'gcc/lra-lives.c')
-rw-r--r--gcc/lra-lives.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c
index 4648eca..df7e253 100644
--- a/gcc/lra-lives.c
+++ b/gcc/lra-lives.c
@@ -220,6 +220,9 @@ lra_intersected_live_ranges_p (lra_live_range_t r1, lra_live_range_t r2)
return false;
}
+/* The corresponding bitmaps of BB currently being processed. */
+static bitmap bb_killed_pseudos, bb_gen_pseudos;
+
/* The function processing birth of hard register REGNO. It updates
living hard regs, START_LIVING, and conflict hard regs for living
pseudos. Conflict hard regs for the pic pseudo is not updated if
@@ -243,6 +246,8 @@ make_hard_regno_born (int regno, bool check_pic_pseudo_p ATTRIBUTE_UNUSED)
|| i != REGNO (pic_offset_table_rtx))
#endif
SET_HARD_REG_BIT (lra_reg_info[i].conflict_hard_regs, regno);
+ if (fixed_regs[regno])
+ bitmap_set_bit (bb_gen_pseudos, regno);
}
/* Process the death of hard register REGNO. This updates
@@ -255,6 +260,11 @@ make_hard_regno_dead (int regno)
return;
sparseset_set_bit (start_dying, regno);
CLEAR_HARD_REG_BIT (hard_regs_live, regno);
+ if (fixed_regs[regno])
+ {
+ bitmap_clear_bit (bb_gen_pseudos, regno);
+ bitmap_set_bit (bb_killed_pseudos, regno);
+ }
}
/* Mark pseudo REGNO as living at program point POINT, update conflicting
@@ -299,9 +309,6 @@ mark_pseudo_dead (int regno, int point)
}
}
-/* The corresponding bitmaps of BB currently being processed. */
-static bitmap bb_killed_pseudos, bb_gen_pseudos;
-
/* Mark register REGNO (pseudo or hard register) in MODE as live at
program point POINT. Update BB_GEN_PSEUDOS.
Return TRUE if the liveness tracking sets were modified, or FALSE