Bug 15193 - [3.4/4.0 Regression] Unary minus using pointer to V4SF vector causes -fforce-mem to exhaust all memory
Summary: [3.4/4.0 Regression] Unary minus using pointer to V4SF vector causes -fforce-...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.1
Assignee: Richard Henderson
URL:
Keywords: ice-on-valid-code, memory-hog
Depends on:
Blocks:
 
Reported: 2004-04-28 19:05 UTC by bert hubert
Modified: 2004-10-30 21:11 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 3.3.3
Known to fail: 3.4.0 4.0.0
Last reconfirmed: 2004-04-28 19:16:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bert hubert 2004-04-28 19:05:56 UTC
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 Andrew Pinski 2004-04-28 19:16:49 UTC
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 Mark Mitchell 2004-06-05 20:37:10 UTC
Richard --

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

Tnanks,

-- Mark
Comment 3 Richard Henderson 2004-06-07 17:18:18 UTC
Patch in progress.
Comment 4 CVS Commits 2004-06-07 17:21:14 UTC
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 CVS Commits 2004-06-07 18:09:28 UTC
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 Richard Henderson 2004-06-07 18:10:23 UTC
Fixed.