http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59307

            Bug ID: 59307
           Summary: ICE with boost::format and ubsan
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: larsbj at gullik dot net
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

Created attachment 31304
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31304&action=edit
Preprocessed file showing the ICE

With g++ (GCC) 4.9.0 20131121 (experimental) and this program:

----------------
#include <boost/format.hpp>

int main()
{
    boost::format f("%s");
    return 0;
}
----------------

I get this ICE (shown with the preprocessed code in attachment):

g++ -std=gnu++11 -O0 --sanitize=undefined format-ice.ii
format-ice.cpp: In member function ‘bool
(boost::optional_detail::optional_base<T>::*
boost::optional_detail::optional_base<T>::safe_bool() const)() const [with T =
std::locale; boost::optional_detail::optional_base<T>::unspecified_bool_type =
bool (boost::optional_detail::optional_base<std::locale>::*)() const;
boost::optional_detail::optional_base<T>::this_type =
boost::optional_detail::optional_base<std::locale>]’:
format-ice.cpp:10:1: internal compiler error: Segmentation fault
 }
 ^
0x93c0af crash_signal
        ../../gcc/gcc/toplev.c:336
0xa1dbf6 get_expr_operands
        ../../gcc/gcc/tree-ssa-operands.c:732
0xa1e563 parse_ssa_operands
        ../../gcc/gcc/tree-ssa-operands.c:951
0xa1fb47 build_ssa_operands
        ../../gcc/gcc/tree-ssa-operands.c:966
0xa1fb47 update_stmt_operands(gimple_statement_base*)
        ../../gcc/gcc/tree-ssa-operands.c:1103
0x7c0bdf update_stmt_if_modified
        ../../gcc/gcc/gimple-ssa.h:154
0x7c0bdf update_modified_stmt
        ../../gcc/gcc/gimple-iterator.c:50
0x7c0bdf gsi_insert_before(gimple_stmt_iterator_d*, gimple_statement_base*,
gsi_iterator_update)
        ../../gcc/gcc/gimple-iterator.c:517
0x9516ad instrument_member_call
        ../../gcc/gcc/ubsan.c:595
0x9516ad instrument_null
        ../../gcc/gcc/ubsan.c:628
0xae1acb walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node*
(*)(tree_node**, int*, void*), void*, pointer_set_t*))
        ../../gcc/gcc/tree.c:10927
0x7cddc2 walk_gimple_op(gimple_statement_base*, tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gcc/gimple-walk.c:203
0x95150a ubsan_pass
        ../../gcc/gcc/ubsan.c:655
0x95150a execute
        ../../gcc/gcc/ubsan.c:694

--sanitize=address does not give the same ICE.

Possibly related to pr59250.

Reply via email to