Darwin : Fix out-of-bounds access to df_regs_ever_live.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 3 Apr 2021 09:07:48 +0000 (10:07 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 3 Apr 2021 20:28:15 +0000 (21:28 +0100)
commit89bc1d4e7cdd0b2d012050134ad1d464ec357f0b
tree687fe8d93b89cace4e5a7c98fdf1cf819b8a73f1
parentad7c6298b6f1cf4eaa70a53af3479fab14018896
Darwin : Fix out-of-bounds access to df_regs_ever_live.

During changes made for LRA (or, perhaps, even before) we omitted
a check that the current register we are working on is a hard reg
before we tried to note its liveness.

A stage 1 built with fsanitize=address catches this, as does any
attempt to build master with clang and -std=c++11.

gcc/ChangeLog:

* config/darwin.c (machopic_legitimize_pic_address): Check
that the current pic register is one of the hard reg set
before setting liveness.
gcc/config/darwin.c