On 7/10/13 5:51 AM, David Given wrote: > I think I have found a bug. This is in stock gcc 4.8.1... > > My backend does not use the 'enabled' attribute; therefore the following > code in insn-attr.h kicks in: > > #ifndef HAVE_ATTR_enabled > #define HAVE_ATTR_enabled 0 > #endif > > Therefore the following code in gcc/lra-constraints.c is enabled: > > #ifdef HAVE_ATTR_enabled > if (curr_id->alternative_enabled_p != NULL > && ! curr_id->alternative_enabled_p[nalt]) > continue; > #endif > > ->alternative_enabled_p is bogus; therefore segfault. > > Elsewhere I see structures of the form: > > #if HAVE_ATTR_enabled > ... > #endif > > So I think that #ifdef above is a straight typo. Certainly, changing it > to a #if makes the crash go away... >
Hi, Vladimir, Apparently the issue that David mentioned has already been fixed earlier: http://gcc.gnu.org/r198344 2013-04-26 Vladimir Makarov <vmaka...@redhat.com> ... * lra-constraints.c (curr_insn_set): New. ... (process_alt_operands): Use it. Use #if HAVE_ATTR_enabled instead of #ifdef. Add code to remove cycling. ... However, such change is only applied on trunk but not on 4.8 branch. Since 4.8 branch is still open and this issue seems to be a bug, perhaps it is a good idea to backport this part. What do you think? :) Best regards, jasonwucj