[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2021-05-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Richard Biener  ---
So this instance won't be fixed since GCC 7 is no longer supported and the
issue doesn't reproduce on maintained branches.  Whilst the issue likely being
latent we lack a testcase so closing.

[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2019-08-30 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

--- Comment #8 from Richard Biener  ---
(In reply to Martin Liška from comment #7)
> (In reply to Richard Biener from comment #6)
> > (In reply to Martin Liška from comment #5)
> > > It was fixed in r227942 and I see all active branches (7,8,9) are fine as
> > > well.
> > 
> > Thanks for bisecting.  That doesn't look like a real fix though, also
> > it still fails for me on the head of the GCC 7 branch.
> 
> You are right. I was testing the original test-case with original
> command-line options. The reduced one from
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434#c1 was fixed in r248771.

OK, that was probably a "real" fix but not necessarily complete for the
issue the original testcase highlighted.

[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2019-08-30 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

--- Comment #7 from Martin Liška  ---
(In reply to Richard Biener from comment #6)
> (In reply to Martin Liška from comment #5)
> > It was fixed in r227942 and I see all active branches (7,8,9) are fine as
> > well.
> 
> Thanks for bisecting.  That doesn't look like a real fix though, also
> it still fails for me on the head of the GCC 7 branch.

You are right. I was testing the original test-case with original command-line
options. The reduced one from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434#c1 was fixed in r248771.

[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2019-08-30 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

Richard Biener  changed:

   What|Removed |Added

   Keywords|needs-bisection |

--- Comment #6 from Richard Biener  ---
(In reply to Martin Liška from comment #5)
> It was fixed in r227942 and I see all active branches (7,8,9) are fine as
> well.

Thanks for bisecting.  That doesn't look like a real fix though, also
it still fails for me on the head of the GCC 7 branch.

[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2019-08-30 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #5 from Martin Liška  ---
It was fixed in r227942 and I see all active branches (7,8,9) are fine as well.

[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2019-08-30 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

Richard Biener  changed:

   What|Removed |Added

   Keywords||needs-bisection
  Known to work||10.0, 8.1.0, 9.1.0
  Known to fail||7.4.0

--- Comment #4 from Richard Biener  ---
This seems to work since 8.1 but still fails on the 7 branch.  While I remember
efforts to sprinkle rewrite-to-defined-overflow around I don't see any such
in the vicinity of the ICE so I wonder if the ICE just got away because of
IVOPTs heuristic changes.

[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2015-06-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

--- Comment #3 from Richard Biener  ---
Ok, so it boils down to fold-const.c moving computations into cond ? expr : cst
and thus exposing the possible trapping expressions inside the conditional
(which comes from number of iteration analysis maybe-zero condition).

There isn't a convenient way to disable this (and no reason to do that for
GENERIC).

#0  fold_build2_stat_loc (loc=0, code=PLUS_EXPR, 
type=, 
op0=, op1=)
at /space/rguenther/tramp3d/trunk/gcc/fold-const.c:14279
#1  0x00c52d78 in fold_plusminus_mult_expr (loc=0, code=PLUS_EXPR, 
type=, 
arg0=, arg1=)
at /space/rguenther/tramp3d/trunk/gcc/fold-const.c:7274
#2  0x00c5f5cc in fold_binary_loc (loc=0, code=PLUS_EXPR, 
type=, 
op0=, op1=)
at /space/rguenther/tramp3d/trunk/gcc/fold-const.c:10086
#3  0x00c75289 in fold_build2_stat_loc (loc=0, code=PLUS_EXPR, 
type=, 
op0=, op1=)
at /space/rguenther/tramp3d/trunk/gcc/fold-const.c:14279
#4  0x00c5e758 in fold_binary_loc (loc=0, code=PLUS_EXPR, 
type=, 
op0=, op1=)
at /space/rguenther/tramp3d/trunk/gcc/fold-const.c:9912
#5  0x00c75289 in fold_build2_stat_loc (loc=0, code=PLUS_EXPR, 
type=, 
op0=, op1=)
at /space/rguenther/tramp3d/trunk/gcc/fold-const.c:14279
#6  0x0188ed24 in chrec_fold_plus_1 (code=PLUS_EXPR, 
type=, 
op0=, op1=)
at /space/rguenther/tramp3d/trunk/gcc/tree-chrec.c:360
#7  0x0188ee34 in chrec_fold_plus (
type=, 
op0=, op1=)
at /space/rguenther/tramp3d/trunk/gcc/tree-chrec.c:393
#8  0x0115477e in add_to_evolution_1 (loop_nb=4, 
chrec_before=, 
to_add=, at_stmt=)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:672
#9  0x01154b2e in add_to_evolution (loop_nb=4, 
chrec_before=, code=PLUS_EXPR, 
to_add=, at_stmt=)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:865
#10 0x01154f70 in follow_ssa_edge_binary (loop=0x76a4d620, 
at_stmt=, 
type=, 
rhs0=, code=PLUS_EXPR, 
rhs1=, halting_phi=0x76a5c300, 
evolution_of_loop=0x7fffd460, limit=2)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1008
#11 0x0115531e in follow_ssa_edge_expr (loop=0x76a4d620, 
at_stmt=, expr=, 
halting_phi=0x76a5c300, evolution_of_loop=0x7fffd460, limit=2)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1113
#12 0x01155a63 in follow_ssa_edge_inner_loop_phi (
outer_loop=0x76a4d620, loop_phi_node=0x76a5cb00, 
halting_phi=0x76a5c300, evolution_of_loop=0x7fffd460, limit=2)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1340
#13 0x01155b91 in follow_ssa_edge (loop=0x76a4d620, 
def=, halting_phi=0x76a5c300, 
evolution_of_loop=0x7fffd460, limit=1)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1389
#14 0x01154d8b in follow_ssa_edge_binary (loop=0x76a4d620, 
at_stmt=, 
type=, 
rhs0=, code=PLUS_EXPR, 
rhs1=, halting_phi=0x76a5c300, 
evolution_of_loop=0x7fffd5d0, limit=1)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:961
#15 0x0115565b in follow_ssa_edge_in_rhs (loop=0x76a4d620, 
stmt=, halting_phi=0x76a5c300, 
evolution_of_loop=0x7fffd5d0, limit=0)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1181
#16 0x01155bb8 in follow_ssa_edge (loop=0x76a4d620, 
def=, halting_phi=0x76a5c300, 
evolution_of_loop=0x7fffd5d0, limit=0)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1396
#17 0x011557b4 in follow_ssa_edge_in_condition_phi_branch (i=0, 
loop=0x76a4d620, condition_phi=0x76a5c900, 
halting_phi=0x76a5c300, evolution_of_branch=0x7fffd5d0, 
init_cond=, limit=0)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1236
#18 0x01155811 in follow_ssa_edge_in_condition_phi (
loop=0x76a4d620, condition_phi=0x76a5c900, 
halting_phi=0x76a5c300, evolution_of_loop=0x7fffd680, limit=0)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1264
#19 0x01155b24 in follow_ssa_edge (loop=0x76a4d620, 
def=, halting_phi=0x76a5c300, 
evolution_of_loop=0x7fffd680, limit=0)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1371
#20 0x0115603f in analyze_evolution_in_loop (
loop_phi_node=0x76a5c300, init_cond=)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1507
#21 0x011564f9 in interpret_loop_phi (loop=0x76a4d620, 
loop_phi_node=0x76a5c300)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evolution.c:1660
#22 0x0115784c in analyze_scalar_evolution_1 (loop=0x76a4d620, 
var=, res=)
at /space/rguenther/tramp3d/trunk/gcc/tree-scalar-evol

[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2015-06-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

--- Comment #2 from Richard Biener  ---
The issue is in IVOPTs:

#13 0x011ed370 in create_iv (base=, 
step=, var=, 
loop=0x76a4d620, incr_pos=0x7fffd880, after=true, 
var_before=0x2523a20, var_after=0x2523a28)
at /space/rguenther/tramp3d/trunk/gcc/tree-ssa-loop-manip.c:147
147   step = force_gimple_operand (step, &stmts, true, NULL_TREE);
(gdb) l
142 step = fold_build1 (NEGATE_EXPR, TREE_TYPE (step), step);
143   incr_op = POINTER_PLUS_EXPR;
144 }
145   /* Gimplify the step if necessary.  We put the computations in front
of the
146  loop (i.e. the step should be loop invariant).  */
147   step = force_gimple_operand (step, &stmts, true, NULL_TREE);
148   if (stmts)
149 gsi_insert_seq_on_edge_immediate (pe, stmts);
150
151   stmt = gimple_build_assign (va, incr_op, vb, step);

ends up trying to gimplfy

(long unsigned int) ((if (_40 > 0)
  {
iftmp.23 = _14 + 1;
  }
else
  {
iftmp.23 = 1;
  }) * pretmp_43)

but we can't put GENERIC COND_EXPR into GIMPLE via force_gimple_operand ().
At least not iff it contains possibly trapping operations.

ISTR fixing up places to avoid gobbling up trapping expressions, so I'll have
a look (it's SCEV analysis).


[Bug middle-end/66434] cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4616

2015-06-05 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66434

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-06-05
 CC||trippels at gcc dot gnu.org
  Component|c++ |middle-end
 Ever confirmed|0   |1
  Known to fail||4.8.4, 4.9.2, 5.1.0, 6.0

--- Comment #1 from Markus Trippelsdorf  ---
markus@x4 tmp % cat pair_hybrid.ii
class Memory *a;
class Memory
{
public:
  int create_j;
  int *create_data;
  int **create_plane;
  int create_n3;
  void
  m_fn1 (int, int p2, int p3, char *)
  {
long n;
for (; 0 < p2;)
  {
create_j = 0;
for (; create_j < p3; create_j++)
  {
create_plane[create_j] = &create_data[n];
n += create_n3;
  }
  }
  }
};
void
fn1 ()
{
  int n;
  for (;;)
a->m_fn1 (0, n + 1, n + 1, "");
}

markus@x4 tmp % g++ -w -c -O2 -ftrapv pair_hybrid.ii
In function ‘void fn1()’:
cc1plus: internal compiler error: in gimplify_modify_expr, at gimplify.c:4753

All supported gcc versions ICE.