Message ID | ord0qg79hw.fsf@lxoliva.fsfla.org |
---|---|
State | New |
Headers | show |
Series | avoid null ptr deref in cselib_record_sets | expand |
On Wed, Dec 05, 2018 at 04:50:19AM -0200, Alexandre Oliva wrote: > Jeff tested this with a cross compiler to h8300-elf, and several other > native and cross toolchains IIUC. I'm regstrapping it myself on i686- > and x86_64-linux-gnu. Ok to install? > > > for gcc/ChangeLog > > * cselib.c (cselib_record_sets): Skip strict low part sets > with NULL src_elt. Ok, thanks. > --- a/gcc/cselib.c > +++ b/gcc/cselib.c > @@ -2616,6 +2616,7 @@ cselib_record_sets (rtx_insn *insn) > preserves the upper bits that di:SI=zero_extend(flags:CCNO<=0). */ > scalar_int_mode mode; > if (dest != orig > + && sets[i].src_elt > && cselib_record_sets_hook > && REG_P (dest) > && HARD_REGISTER_P (dest) Jakub
diff --git a/gcc/cselib.c b/gcc/cselib.c index 6d3a4078c689..4a68439455fd 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -2616,6 +2616,7 @@ cselib_record_sets (rtx_insn *insn) preserves the upper bits that di:SI=zero_extend(flags:CCNO<=0). */ scalar_int_mode mode; if (dest != orig + && sets[i].src_elt && cselib_record_sets_hook && REG_P (dest) && HARD_REGISTER_P (dest)