Commit 74b4885d by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/80903 (ICE: internal consistency failure (error: invalid…

re PR rtl-optimization/80903 (ICE: internal consistency failure (error: invalid rtl sharing found in the insn))

	PR rtl-optimization/80903
	* loop-doloop.c (add_test): Unshare sequence.

	* gcc.dg/pr80903.c: New test.

From-SVN: r248815
parent aad16012
2017-06-02 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80903
* loop-doloop.c (add_test): Unshare sequence.
2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de> 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
* doc/invoke.texi: Document the -Wsizeof-pointer-div warning. * doc/invoke.texi: Document the -Wsizeof-pointer-div warning.
......
...@@ -367,6 +367,7 @@ add_test (rtx cond, edge *e, basic_block dest) ...@@ -367,6 +367,7 @@ add_test (rtx cond, edge *e, basic_block dest)
} }
seq = get_insns (); seq = get_insns ();
unshare_all_rtl_in_chain (seq);
end_sequence (); end_sequence ();
/* There always is at least the jump insn in the sequence. */ /* There always is at least the jump insn in the sequence. */
......
2017-06-02 Jakub Jelinek <jakub@redhat.com> 2017-06-02 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80903
* gcc.dg/pr80903.c: New test.
PR fortran/80918 PR fortran/80918
* gfortran.dg/gomp/pr80918.f90: New test. * gfortran.dg/gomp/pr80918.f90: New test.
......
/* PR rtl-optimization/80903 */
/* { dg-do compile } */
/* { dg-options "-O3 -funroll-loops" } */
short int a;
void
foo (int x, short int y, short int z)
{
if (y != 0)
{
const short int b = 37;
y = 0;
while (y < b)
{
while (y < b)
{
lab:
++y;
}
for (y = 0; y < b - 1; ++y)
;
if (z != 0)
{
--a;
y *= a;
}
z = x;
}
x = 0;
}
goto lab;
}
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