On Sun, Oct 19, 2014 at 8:13 PM, Uros Bizjak <ubiz...@gmail.com> wrote: > Hello! > > The fix that fixed scheduler issues with AND addresses (the fix > prevented early exit for MEM_READONLY_P addresses when AND alignment > addresses were involved) caused some fall-out for libgo testsuite. > These tests triggered an assert in mems_in_disjoint_alias_sets_p, > which checks for zero alias set when flag_strict_aliasing is false. We > have had some off-list discussion with Ian Lance Taylor about this > issue. > > The problem was, that Go dynamically switches off flag_strict_aliasing > after compilation started and when "unsafe" package is imported > (similar to when__attribute__ ((optimize ("-fno-strict-aliasing"))) is > used in c). To mitigate this issue, the Go frontend called > varasm_init_once again to recalculated (= cleared) const_alias_set in > this case. > > As observed in [1], the fix for canon_true_depence [2] that introduced > quick exit for a MEM_READONLY_P operands made const_alias_set > redundant, it is no longer user for anything. > > The patch that fixed scheduling of AND operands removed early > MEM_READONLY_P exit for memory operands with AND realignment, so > operands could reach more complex code later in the function that was > able to determine dependence of memory operands. This code includes > the call to mems_in_disjoint_alias_sets_p, and the assert triggered > again for some MEM_READONLY_P operands that have had non-zero alias > set, set from the value, cached in const_alias_set from before > flag_strict_aliasing flag was cleared. > > The proposed solution is to remove const_alias_set altogether. The > MEM_READONLY_P successfully supersedes const_alias_set functionality, > and this is also confirmed by the removal of the second > varasm_init_once call in the Go frontend. In an off-list discussion, > Ian agrees that attached patch should also fix the problem. > > 2014-10-19 Uros Bizjak <ubiz...@gmail.com> > > * varasm.c (const_alias_set): Remove. > (init_varasm_once): Remove initialization of const_alias_set. > (build_constant_desc): Do not set alias set to const_alias_set. > > The patch was tested on alpha-linux-gnu [3], alphaev68-linux-gnu and > x86_64-linux-gnu {,-m32} for all default languages plus Go and > obj-c++. > > The patch fixes all mentioned libgo failures on alpha. > > OK for mainline?
Ok. Thanks, Richard. > [1] https://gcc.gnu.org/ml/gcc-patches/2013-07/msg01033.html > [2] https://gcc.gnu.org/ml/gcc-patches/2010-07/msg01758.html > [3] https://gcc.gnu.org/ml/gcc-testresults/2014-10/msg02041.html > > Uros.