Commit 4f7a634e by Easwaran Raman

re PR tree-optimization/57322 (Segfault at -O1 in build_and_add_sum)

2013-05-21  Easwaran Raman  <eraman@google.com>

	PR tree-optimization/57322
	* (build_and_add_sum): If a BB is empty, set the UID of the statement
	added to the BB to be 1.

testsuite/ChangeLog:

2013-05-21  Easwaran Raman  <eraman@google.com>

	PR tree-optimization/57322
	* gcc.dg/tree-ssa/reassoc-29.c: New testcase.

From-SVN: r199165
parent 63987952
2013-05-21 Easwaran Raman <eraman@google.com>
PR tree-optimization/57322
* (build_and_add_sum): If a BB is empty, set the UID of the statement
added to the BB to be 1.
2013-05-21 Jakub Jelinek <jakub@redhat.com> 2013-05-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57331 PR tree-optimization/57331
...@@ -46,6 +52,7 @@ ...@@ -46,6 +52,7 @@
* config/sh/sh.md (fmasf4): Remove empty constraints strings. * config/sh/sh.md (fmasf4): Remove empty constraints strings.
(*fmasf4, *fmasf4_media): New insns. (*fmasf4, *fmasf4_media): New insns.
>>>>>>> .r199151
2013-05-19 Richard Sandiford <rdsandiford@googlemail.com> 2013-05-19 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.h (BASE_INSN_LENGTH, NOP_INSN_LENGTH): New macros. * config/mips/mips.h (BASE_INSN_LENGTH, NOP_INSN_LENGTH): New macros.
......
2013-05-21 Easwaran Raman <eraman@google.com>
PR tree-optimization/57322
* gcc.dg/tree-ssa/reassoc-29.c: New testcase.
2013-05-21 Graham Stott <graham.stott@btinternet.com> 2013-05-21 Graham Stott <graham.stott@btinternet.com>
* lib/scanasm.exp (dg-function-on-line): Make MIPS targets match * lib/scanasm.exp (dg-function-on-line): Make MIPS targets match
...@@ -105,7 +110,7 @@ ...@@ -105,7 +110,7 @@
PR c++/57175 PR c++/57175
* g++.dg/pr57175.C: New testcase. * g++.dg/pr57175.C: New testcase.
2013-05-17 Easwaran Raman <eraman@google.com> 2013-05-17 Easwaran Raman <eraman@google.com>
* gcc.dg/tree-ssa/reassoc-28.c: New testcase. * gcc.dg/tree-ssa/reassoc-28.c: New testcase.
......
/* PR tree-optimization/57322 */
/* { dg-do compile } */
/* { dg-options "-w -O1" } */
int a;
void f (void)
{
char b;
for (;; a++)
{
char *p = &b, *q;
*q = b < 0 & !!*p;
}
}
...@@ -1165,8 +1165,12 @@ build_and_add_sum (tree type, tree op1, tree op2, enum tree_code opcode) ...@@ -1165,8 +1165,12 @@ build_and_add_sum (tree type, tree op1, tree op2, enum tree_code opcode)
if ((!op1def || gimple_nop_p (op1def)) if ((!op1def || gimple_nop_p (op1def))
&& (!op2def || gimple_nop_p (op2def))) && (!op2def || gimple_nop_p (op2def)))
{ {
gimple first_stmt;
unsigned uid;
gsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR)); gsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR));
gimple_set_uid (sum, gimple_uid (gsi_stmt (gsi))); first_stmt = gsi_stmt (gsi);
uid = first_stmt ? gimple_uid (first_stmt) : 1;
gimple_set_uid (sum, uid);
gsi_insert_before (&gsi, sum, GSI_NEW_STMT); gsi_insert_before (&gsi, sum, GSI_NEW_STMT);
} }
else if ((!op1def || gimple_nop_p (op1def)) else if ((!op1def || gimple_nop_p (op1def))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment