https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82939

--- Comment #5 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #4)
> Created attachment 42594 [details]
> genmatch crash report
> 
> (In reply to Richard Biener from comment #3)
> > Hmm, GCC 4.2 as host compiler and using non-standard flags (-Os).  Can you
> > try
> > with standard flags?  It's probably miscompiling libcpp and/or genmatch.
> 
> When removing -Os it instead segfaults:
> 
> build/genmatch --gimple ../../gcc/match.pd \
>           > tmp-gimple-match.c
> /bin/sh: line 1: 76756 Segmentation fault      build/genmatch --gimple
> ../../gcc/match.pd > tmp-gimple-match.c
> make[3]: *** [s-match] Error 139
> make[2]: *** [all-stage1-gcc] Error 2
> make[1]: *** [stage1-bubble] Error 2
> make: *** [all] Error 2
> 
> Attaching the crash reporter log.

I should probably also include the compilation warnings from a little above the
crash:

/usr/bin/g++-4.2 -c   -g  -DIN_GCC -fPIC   -fno-strict-aliasing -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual
-Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H
-DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc -I../../gcc/build
-I../../gcc/../include  -I../../gcc/../libcpp/include -I/opt/local/include \
                -o build/genmatch.o ../../gcc/genmatch.c
../../gcc/vec.h: In static member function ‘static size_t vec<T, A,
vl_embed>::embedded_size(unsigned int) [with T = c_expr::id_tab, A = va_heap]’:
../../gcc/vec.h:286:   instantiated from ‘static void va_heap::reserve(vec<T,
va_heap, vl_embed>*&, unsigned int, bool) [with T = c_expr::id_tab]’
../../gcc/vec.h:1473:   instantiated from ‘bool vec<T, va_heap,
vl_ptr>::reserve(unsigned int, bool) [with T = c_expr::id_tab]’
../../gcc/vec.h:1582:   instantiated from ‘T* vec<T, va_heap,
vl_ptr>::safe_push(const T&) [with T = c_expr::id_tab]’
../../gcc/genmatch.c:1330:   instantiated from here
../../gcc/vec.h:1075: warning: invalid access to non-static data member
‘vec<c_expr::id_tab, va_heap, vl_embed>::m_vecdata’ of NULL object
../../gcc/vec.h:1075: warning: (perhaps the ‘offsetof’ macro was used
incorrectly)
../../gcc/vec.h: In static member function ‘static size_t vec<T, A,
vl_embed>::embedded_size(unsigned int) [with T = std::pair<user_id*, id_base*>,
A = va_heap]’:
../../gcc/vec.h:286:   instantiated from ‘static void va_heap::reserve(vec<T,
va_heap, vl_embed>*&, unsigned int, bool) [with T = std::pair<user_id*,
id_base*>]’
../../gcc/vec.h:1473:   instantiated from ‘bool vec<T, va_heap,
vl_ptr>::reserve(unsigned int, bool) [with T = std::pair<user_id*, id_base*>]’
../../gcc/vec.h:1493:   instantiated from ‘bool vec<T, va_heap,
vl_ptr>::reserve_exact(unsigned int) [with T = std::pair<user_id*, id_base*>]’
../../gcc/vec.h:1556:   instantiated from ‘void vec<T, va_heap,
vl_ptr>::safe_splice(const vec<T, va_heap, vl_ptr>&) [with T =
std::pair<user_id*, id_base*>]’
../../gcc/genmatch.c:1462:   instantiated from here
../../gcc/vec.h:1075: warning: invalid access to non-static data member
‘vec<std::pair<user_id*, id_base*>, va_heap, vl_embed>::m_vecdata’ of NULL
object
../../gcc/vec.h:1075: warning: (perhaps the ‘offsetof’ macro was used
incorrectly)

Reply via email to