Bug 15193 - [3.4/4.0 Regression] Unary minus using pointer to V4SF vector causes -fforce-mem to exhaust all memory
Bug#: 15193 Product:  gcc Version: 3.4.0
Host: i686-pc-linux-gnu Target: i686-pc-linux-gnu Build: i686-pc-linux-gnu
Status: RESOLVED Severity: critical Priority: P2
Resolution: FIXED Assigned To: rth@gcc.gnu.org Reported By: ahu@ds9a.nl
Component: rtl-optimization Target Milestone: 3.4.1
Summary: [3.4/4.0 Regression] Unary minus using pointer to V4SF vector causes -fforce-mem to exhaust all memory
Keywords:  ice-on-valid-code, memory-hog
Opened: 2004-04-28 19:05
Description:   Last confirmed: 2004-04-28 19:16 Opened: 2004-04-28 19:05
Compile the below with gcc chelper-exploit.c -c -O -fforce-mem -msse :
typedef int v4sf __attribute__ ((mode(V4SF)));

void cprocess(v4sf* d_r) 
{
 v4sf force= -(*d_r);
}

And the compiler (cc1) will try to allocate all memory.

Problem disappears with removing the '-', or by switching to 3.3.3 or to the SSA
branche, by removing -O or removing -fforce-mem, by removing -msse

------- Comment #1 From Andrew Pinski 2004-04-28 19:16 -------
Confirmed, here is an example which is happens even on the tree-ssa:
typedef int v4sf __attribute__ ((mode(V4SF)));

v4sf cprocess(v4sf* d_r)
{
 v4sf force= -(*d_r);
  return force;
}

------- Comment #2 From Mark Mitchell 2004-06-05 20:37 -------
Richard --

As the IA32 maintainer, would you please look at this?

Tnanks,

-- Mark

------- Comment #3 From Richard Henderson 2004-06-07 17:18 -------
Patch in progress.

------- Comment #4 From CVS Commits 2004-06-07 17:21 -------
Subject: Bug 15193

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2004-06-07 17:21:07

Modified files:
	gcc            : ChangeLog expmed.c 
	gcc/config/i386: i386.md 

Log message:
	PR rtl-opt/15193
	* expmed.c (extract_bit_field): Fix vector_extract return.
	* config/i386/i386.md (negv4sf2): New pattern.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3861&r2=2.3862
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expmed.c.diff?cvsroot=gcc&r1=1.160&r2=1.161
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.541&r2=1.542


------- Comment #5 From CVS Commits 2004-06-07 18:09 -------
Subject: Bug 15193

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	rth@gcc.gnu.org	2004-06-07 18:09:13

Modified files:
	gcc            : ChangeLog expmed.c 

Log message:
	PR rtl-opt/15193
	* expmed.c (extract_bit_field): Fix vector_extract return.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.472&r2=2.2326.2.473
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expmed.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.148.4.1&r2=1.148.4.2


------- Comment #6 From Richard Henderson 2004-06-07 18:10 -------
Fixed.