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

            Bug ID: 59647
           Summary: [4.8] ICE in simplify_const_unary_operation, at
                    simplify-rtx.c:1597
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Google ref: b/12262120

4.8 is broken, trunk does not fail (not sure whether the problem is fixed on
trunk, or merely masked by other changes).

void fn1i (int);
void fn1 ();
struct A
{
    int m_fn1 () const
    {
        if (this->_M_impl._M_finish == 0)
            return 1;
        return 0;
    }
    unsigned m_fn2 ()
    {
        if (!this->m_fn1 ())
            fn1 ();
        return this->_M_impl._M_finish;
    }
    double operator[] (int);
    struct B
    {
        int _M_finish;
    };
    B _M_impl;
};

void
fn2 (A & p1)
{
    unsigned b = p1.m_fn2 ();
    fn1i (b - 1 - p1[p1.m_fn2 () - 1]);
}

gcc --version
gcc (GCC) 4.8.3 20131230 (prerelease)

Configured for x86_64.


gcc -c t.ii -m32 -fno-tree-vrp -mfpmath=sse -O2 
t.ii: In function ‘void fn2(A&)’:
t.ii:30:1: internal compiler error: in simplify_const_unary_operation, at
simplify-rtx.c:1597
 }
 ^
0x891d5a simplify_const_unary_operation(rtx_code, machine_mode, rtx_def*,
machine_mode)
        ../../gcc/simplify-rtx.c:1597
0x888b2a simplify_unary_operation(rtx_code, machine_mode, rtx_def*,
machine_mode)
        ../../gcc/simplify-rtx.c:796
0xbfcbd6 fold_rtx
        ../../gcc/cse.c:3287
0xc01fd1 canonicalize_insn
        ../../gcc/cse.c:4396
0xc01fd1 cse_insn
        ../../gcc/cse.c:4490
0xc038e3 cse_extended_basic_block
        ../../gcc/cse.c:6405
0xc038e3 cse_main
        ../../gcc/cse.c:6583
0xc03d06 rest_of_handle_cse
        ../../gcc/cse.c:7433
Please submit a full bug report,
with preprocessed source if appropriate.

Reply via email to