Bug 55775 - [4.8 Regression] ICE when building pari
Summary: [4.8 Regression] ICE when building pari
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: inline-asm (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ra
Depends on:
Blocks:
 
Reported: 2012-12-21 15:22 UTC by Jakub Jelinek
Modified: 2013-01-14 19:35 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2012-12-21 15:22:58 UTC
int *ptr;
int *fn1 (int *);
int fn2 (int, int);
int fn3 (void);
int fn4 (int);

static int
foo (int x, int y, int z)
{
  int b;
  asm ("" : "=a" (b), "=&d" (x) : "0" (y), "1" (x), "mr" (z));
  return x;
}

static int
bar (int x, int y)
{
  int a;
  if (!y)
    {
      for (a = 0; a <= (x >> 1); )
;
      a = foo (y, fn2 (2, x), x);
      if (x)
a = x;
      return a;
    }
}

static int
baz (int x, int y)
{
  int *a = ptr;
  int t, xk1 = fn3 (), xk = x * xk1;
  for (t = 0; t < xk; t += xk1)
    {
      if (fn4 (a[2]))
return -y;
      a = fn1 (a);
    }
  return 0;
}

void
test (int x, long y, int z)
{
  int a = fn3 ();
  int b;
  int c = bar (x, z);
  for (b = 0; b <= y; b++)
    c = baz (x, c);
  fn2 (c, a);
}

ICEs on x86_64-linux with -O1 -w:
lra_ice.i: In function ‘test’:
lra_ice.i:53:1: internal compiler error: Maximum number of LRA constraint passes is achieved (30)

 }
 ^
0x90089c lra_constraints(bool)
../../gcc/lra-constraints.c:3334
0x8f12e6 lra(_IO_FILE*)
../../gcc/lra.c:2280
0x8a6d43 do_reload
../../gcc/ira.c:4624
0x8a6f51 rest_of_handle_reload
../../gcc/ira.c:4737
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Vladimir Makarov 2012-12-21 21:20:55 UTC
Author: vmakarov
Date: Fri Dec 21 21:20:48 2012
New Revision: 194680

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194680
Log:
2012-12-21  Vladimir Makarov  <vmakarov@redhat.com>

	PR middle-end/55775
	* lra-assigns.c (improve_inheritance): Do nothing after
	LRA_MAX_INHERITANCE_PASSES pass.
	* lra-constraints.c (MAX_CONSTRAINT_ITERATION_NUMBER): Rename to
	LRA_MAX_CONSTRAINT_ITERATION_NUMBER.  Move to lra-int.h.
	(MAX_INHERITANCE_PASSES): Rename to LRA_MAX_INHERITANCE_PASSES.
	Move to lra-int.h.
	* lra-int.h (LRA_MAX_CONSTRAINT_ITERATION_NUMBER): Move from
	lra-constraints.c.
	(LRA_MAX_INHERITANCE_PASSES): Ditto.

2012-12-21  Vladimir Makarov  <vmakarov@redhat.com>

	PR middle-end/55775
	* gcc.target/i386/pr55775.c: New test.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr55775.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra-assigns.c
    trunk/gcc/lra-constraints.c
    trunk/gcc/lra-int.h
    trunk/gcc/testsuite/ChangeLog
Comment 2 Jakub Jelinek 2012-12-27 08:45:48 UTC
Fixed.
Comment 3 Steven Bosscher 2013-01-14 19:35:10 UTC
Author: steven
Date: Mon Jan 14 19:35:03 2013
New Revision: 195173

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195173
Log:

	* ira-build.c (ira_flattening): Comment fix.

	Port the following LRA changes on trunk back to the LRA branch:

	2013-01-10  Vladimir Makarov  <vmakarov at redhat dot com>

	PR rtl-optimization/pr55672
	* lra-eliminations.c (mark_not_elimnable): Permit addition with
	const to be elimnable.

	2012-12-21  Vladimir Makarov  <vmakarov at redhat dot com>

	PR middle-end/55775
	* lra-assigns.c (improve_inheritance): Do nothing after
	LRA_MAX_INHERITANCE_PASSES pass.
	* lra-constraints.c (MAX_CONSTRAINT_ITERATION_NUMBER): Rename to
	LRA_MAX_CONSTRAINT_ITERATION_NUMBER.  Move to lra-int.h.
	(MAX_INHERITANCE_PASSES): Rename to LRA_MAX_INHERITANCE_PASSES.
	Move to lra-int.h.
	* lra-int.h (LRA_MAX_CONSTRAINT_ITERATION_NUMBER): Move from
	lra-constraints.c.
	(LRA_MAX_INHERITANCE_PASSES): Ditto.

	2012-12-21  Steve Ellcey  <sellcey at mips dot com>

	PR bootstrap/54128
	* ira.c (build_insn_chain): Check only NONDEBUG instructions for
	register usage.

	2012-12-11  Jakub Jelinek  <jakub at redhat dot com>

	PR rtl-optimization/55193
	* lra-constraints.c (loc_equivalence_callback): New function.
	(lra_constraints): Call simplify_replace_fn_rtx instead of
	loc_equivalence_change_p on DEBUG_INSNs.


Modified:
    branches/lra/gcc/ChangeLog
    branches/lra/gcc/ira-build.c
    branches/lra/gcc/ira.c
    branches/lra/gcc/lra-assigns.c
    branches/lra/gcc/lra-constraints.c
    branches/lra/gcc/lra-eliminations.c
    branches/lra/gcc/lra-int.h