On Wed, Nov 5, 2014 at 7:17 AM, Zamyatin, Igor <igor.zamya...@intel.com> wrote: >> > 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.zamya...@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. >
Please mention PR in ChangeLog and add a few testcases so that the fix will be tested on Linux. -- H.J.