This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH, i686] Fix for asan test failures with -m32 happened after EBX enabling in PIC mode
- From: "Zamyatin, Igor" <igor dot zamyatin at intel dot com>
- To: Jeff Law <law at redhat dot com>, "GCC Patches (gcc-patches at gcc dot gnu dot org)" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Nov 2014 15:17:58 +0000
- Subject: RE: [PATCH, i686] Fix for asan test failures with -m32 happened after EBX enabling in PIC mode
- Authentication-results: sourceware.org; auth=none
- References: <0EFAB2BDD0F67E4FB6CCC8B9F87D756969C18BCF at IRSMSX101 dot ger dot corp dot intel dot com> <5453D872 dot 3070402 at redhat dot com>
> > Hi!
> >
> > Following patch (moving initialization of pic_offset_table_rtx
> earlier) fixes failures for asan tests on 32 bits in PIC mode mentioned here -
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534#c48
> >
> >
> > Bootstrapped/regtested on x86_64, i686
> >
> > Is it ok for trunk?
> >
> > ChangeLog:
> >
> > 2014-10-30 Igor Zamyatin <igor.zamyatin@intel.com>
> >
> > * function.c (assign_parms): Move init of pic_offset_table_rtx
> > from here to...
> > * cfgexpand.c (expand_used_vars): ...here.
> The patch is probably fine. However, it would be good to have the analysis
> why you want to move initialization of the PIC register earlier.
Asan (and anybody else can) emits global variable(s) in expand_used_vars during function expanding while pic reg is currently initialized later, during expand_function_start in assign_parms thus to be late in asan case in PIC mode.
So to avoid such cases we put pic reg initialization in the beginning of expand_used_vars. This seems to be early enough.
Thanks,
Igor