Bug 43300 - [4.5 Regression] ICE: in emit_move_insn, at expr.c:3432
Summary: [4.5 Regression] ICE: in emit_move_insn, at expr.c:3432
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P1 normal
Target Milestone: 4.5.0
Assignee: Michael Matz
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2010-03-09 00:27 UTC by Zdenek Sojka
Modified: 2010-03-15 16:15 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-03-09 16:47:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-03-09 00:27:21 UTC
Testcase is:
gcc.c-torture/compile/pr33614.c
with compiler parameters -Os -fgraphite-identity

------ pr33614.c ------
typedef float V2SF __attribute__ ((vector_size (8)));

V2SF
foo (int x, V2SF a)
{
  while (x--)
    a += (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f};
  return a;
}
-----------------------

Command line:
gcc -Os -fgraphite-identity pr33614.c

Tested revisions:
r157292 - crash
build dated 20100304 - segfault (disabled checking, both x86 and x86_64)
r157161 - crash
r155966 - crash (release checking)
r153685 - crash
4.4 r157120 - OK (checking)
4.4 r153668 - OK (release checking)

Output - enabled checking:
/mnt/svn/gcc-trunk/binary-157161/bin/gcc  -Os -c -fgraphite-identity /mnt/svn/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/pr33614.c
/mnt/svn/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/pr33614.c: In function 'foo':
/mnt/svn/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/pr33614.c:4:1: internal compiler error: in emit_move_insn, at expr.c:3432

Output - disabled checking:
$ gcc-4.5.0-alpha20100304  -Os -c -fgraphite-identity /mnt/svn/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/pr33614.c
gcc-4.5.0-alpha20100304: Internal error: Segmentation fault (program cc1)
Comment 1 Andrew Pinski 2010-03-09 00:34:38 UTC
As far as I can tell this is an out of SSA issue here is a testcase which will fail on every target I know of:
typedef float V2SF __attribute__ ((vector_size (128)));

V2SF
foo (int x, V2SF a)
{
  while (x--)
    a += (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f};
  return a;
}

a's type will have a mode of BLKmode which is correct for vector types.
Comment 2 Andrew Pinski 2010-03-09 00:36:31 UTC
insert_partition_copy_on_edge does not take into account the mode being BLKmode for SSA_NAMEs.  This is only true with vector types.
Comment 3 Sebastian Pop 2010-03-09 00:49:10 UTC
Ok, so then this is not related to Graphite.
I'm removing the Graphite flag from the subject.
Comment 4 Michael Matz 2010-03-09 16:47:50 UTC
This happens only for vector modes which aren't supported by the target.
They will be assigned BLKmode stack slots which right now aren't handled
correctly (incidentally I wonder why Graphite is needed to expose this
situation, without graphite we don't have conflicting SSA partitions).
Anyway, mine.
Comment 5 Michael Matz 2010-03-15 16:13:43 UTC
Subject: Bug 43300

Author: matz
Date: Mon Mar 15 16:13:28 2010
New Revision: 157461

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157461
Log:
	PR middle-end/43300
	* tree-outof-ssa.c (emit_partition_copy): New argument sizeexp,
	use it to expand block copies.
	(insert_partition_copy_on_edge, insert_rtx_to_part_on_edge,
	insert_part_to_rtx_on_edge): Adjust callers of emit_partition_copy.
	(insert_value_copy_on_edge): Use store_expr for BLKmode values.

testsuite/
	* gcc.dg/pr43300.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/pr43300.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-outof-ssa.c

Comment 6 Michael Matz 2010-03-15 16:15:14 UTC
Fixed.  I put in a testcase that doesn't need graphite.
Comment 7 hjl@gcc.gnu.org 2010-03-25 16:40:40 UTC
Subject: Bug 43300

Author: hjl
Date: Thu Mar 25 16:39:51 2010
New Revision: 157726

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157726
Log:
Backport regression testcases from mainline.

2010-03-25  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2010-03-22  Jason Merrill  <jason@redhat.com>

	PR c++/43333
	* g++.dg/ext/is_pod_98.C: New.

	2010-03-22  Michael Matz  <matz@suse.de>

	PR middle-end/43475
	* gfortran.dg/pr43475.f90: New testcase.

	2010-03-22  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43390
	* gfortran.fortran-torture/execute/pr43390.f90: New testcase.

	2010-03-20  Dodji Seketeli  <dodji@redhat.com>

	PR c++/43375
	* g++.dg/abi/mangle42.C: New test.

	2010-03-19  Andrew Pinski  <andrew_pinski@caviumnetworks.com>

	PR C/43211
	* gcc.dg/pr43211.c: New test.

	2010-03-18  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/42450
	* g++.dg/torture/pr42450.C: New test.

	2010-03-18  Michael Matz  <matz@suse.de>

	PR tree-optimization/43402
	* gcc.dg/pr43402.c: New testcase.

	2010-03-17  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/42427
	* gcc.dg/pr42427.c: New test.

	2010-03-16  Richard Guenther  <rguenther@suse.de>

	PR middle-end/43379
	* gcc.dg/pr43379.c: New testcase.

	2010-03-15  Michael Matz  <matz@suse.de>

	PR middle-end/43300
	* gcc.dg/pr43300.c: New testcase.

	2010-03-15  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43367
	* gcc.c-torture/compile/pr43367.c: New testcase.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/abi/mangle42.C
      - copied unchanged from r157725, trunk/gcc/testsuite/g++.dg/abi/mangle42.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/is_pod_98.C
      - copied unchanged from r157725, trunk/gcc/testsuite/g++.dg/ext/is_pod_98.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42450.C
      - copied unchanged from r157725, trunk/gcc/testsuite/g++.dg/torture/pr42450.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43367.c
      - copied unchanged from r157725, trunk/gcc/testsuite/gcc.c-torture/compile/pr43367.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42427.c
      - copied unchanged from r157725, trunk/gcc/testsuite/gcc.dg/pr42427.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43211.c
      - copied unchanged from r157725, trunk/gcc/testsuite/gcc.dg/pr43211.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43300.c
      - copied unchanged from r157725, trunk/gcc/testsuite/gcc.dg/pr43300.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43379.c
      - copied unchanged from r157725, trunk/gcc/testsuite/gcc.dg/pr43379.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43402.c
      - copied unchanged from r157725, trunk/gcc/testsuite/gcc.dg/pr43402.c
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr43475.f90
      - copied unchanged from r157725, trunk/gcc/testsuite/gfortran.dg/pr43475.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90
      - copied unchanged from r157725, trunk/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog