Thread overview
[Bug 223] ARM: internal compiler error: in operand_equal_p, at fold-const.c:2934
May 15, 2016
Iain Buclaw
May 15, 2016
Iain Buclaw
May 15, 2016
Iain Buclaw
May 15, 2016
Iain Buclaw
May 15, 2016
Johannes Pfau
May 15, 2016
Iain Buclaw
May 15, 2016
Johannes Pfau
May 15, 2016
Iain Buclaw
May 22, 2016
Iain Buclaw
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
I don't know where that call to memcmp comes from.

-- 
You are receiving this mail because:
You are watching all bug changes.
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Iain Buclaw from comment #1)
> I don't know where that call to memcmp comes from.

OK, forcing BLKmode on TypeDArray has reproduced it.

Looks like is just a case of not removing side effects of the left and right operands.

-- 
You are receiving this mail because:
You are watching all bug changes.
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
https://github.com/D-Programming-GDC/GDC/pull/205

-- 
You are receiving this mail because:
You are watching all bug changes.
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> ---
https://github.com/D-Programming-GDC/GDC/commit/369de5505f492e808401132e8a222a51b267166f

-- 
You are receiving this mail because:
You are watching all bug changes.
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
         Resolution|FIXED                       |---

--- Comment #5 from Johannes Pfau <johannespfau@gmail.com> ---
I can confirm the initial testcase is fixed, but now there's a similar problem:

--------------------------------------------------------------------
../../../../gcc-6.1.0/libphobos/src/std/range/package.d: In function
'__unittestL1851_24':
../../../../gcc-6.1.0/libphobos/src/std/range/package.d:1877:5: internal
compiler error: in operand_equal_p, at fold-const.c:2934
     assert(take(inf, 5) == takeExactly(inf, 5));
     ^
0x49c0eb operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc-6.1.0/gcc/fold-const.c:2934
0x49a4ff operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc-6.1.0/gcc/fold-const.c:3176
0x49ac67 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc-6.1.0/gcc/fold-const.c:3113
0x348657 fold_builtin_memcmp
        ../../gcc-6.1.0/gcc/builtins.c:7125
0x348657 fold_builtin_3
        ../../gcc-6.1.0/gcc/builtins.c:8224
0x348657 fold_builtin_n(unsigned int, tree_node*, tree_node**, int, bool)
        ../../gcc-6.1.0/gcc/builtins.c:8280
0x349943 fold_call_expr(unsigned int, tree_node*, bool)
        ../../gcc-6.1.0/gcc/builtins.c:8381
0x537b4f gimplify_call_expr
        ../../gcc-6.1.0/gcc/gimplify.c:2450
0x5273e3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-6.1.0/gcc/gimplify.c:10252
0x526e37 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-6.1.0/gcc/gimplify.c:10996
0x536b47 gimplify_cond_expr
        ../../gcc-6.1.0/gcc/gimplify.c:3184
0x527ae7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-6.1.0/gcc/gimplify.c:10237
0x52bdcb gimplify_stmt(tree_node**, gimple**)
        ../../gcc-6.1.0/gcc/gimplify.c:5688
0x52850f gimplify_statement_list
        ../../gcc-6.1.0/gcc/gimplify.c:1537
0x52850f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-6.1.0/gcc/gimplify.c:10698
0x52bdcb gimplify_stmt(tree_node**, gimple**)
        ../../gcc-6.1.0/gcc/gimplify.c:5688
0x52d13b gimplify_bind_expr
        ../../gcc-6.1.0/gcc/gimplify.c:1142
0x526f43 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-6.1.0/gcc/gimplify.c:10480
0x52bdcb gimplify_stmt(tree_node**, gimple**)
        ../../gcc-6.1.0/gcc/gimplify.c:5688
0x52dedb gimplify_body(tree_node*, bool)
        ../../gcc-6.1.0/gcc/gimplify.c:11427
--------------------------------------------------------------------

(I haven't reduced this so far)

-- 
You are receiving this mail because:
You are watching all bug changes.
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

--- Comment #6 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Caused by the exact same symptom though.  Somewhere in ExprVisitor(EqualExp) there needs to be a call to maybe_make_temp.

-- 
You are receiving this mail because:
You are watching all bug changes.
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

--- Comment #7 from Johannes Pfau <johannespfau@gmail.com> ---
Adding maybe_make_temp calls to https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/expr.cc#L266 solves this issue.

But I'm wondering: I guess we have to add maybe_make_temp for everything which could end up in a call to memcpy?

So: https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/expr.cc#L279 Probably not necessary?

https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/expr.cc#L292 https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/expr.cc#L127 https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/expr.cc#L139 https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/expr.cc#L150

-- 
You are receiving this mail because:
You are watching all bug changes.
May 15, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

--- Comment #8 from Iain Buclaw <ibuclaw@gdcproject.org> ---
I'd just make the changes on a per-case basis, but I would have thought it it would just affect RECORD_TYPEs.  Testing each permutation shouldn't be too difficult.

eg:

float test1() { return float ... }
delegate test2() { return delegate ... }


test1() == test1();
test2() == test2();

-- 
You are receiving this mail because:
You are watching all bug changes.
May 22, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=223

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Iain Buclaw <ibuclaw@gdcproject.org> ---
I believe this has been fixed in master now.

-- 
You are receiving this mail because:
You are watching all bug changes.