This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: avoid null ptr deref in cselib_record_sets
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 Dec 2018 09:32:03 +0100
- Subject: Re: avoid null ptr deref in cselib_record_sets
- References: <ord0qg79hw.fsf@lxoliva.fsfla.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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