User account creation filtered due to spam.

Bug 19858 - [4.0 Regression] ICE on simple SSE code
Summary: [4.0 Regression] ICE on simple SSE code
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.0
: P3 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, patch
Depends on: 19857
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-09 17:11 UTC by stevenj@fftw.org
Modified: 2005-02-11 21:16 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 3.3.4
Known to fail: 4.0.0
Last reconfirmed: 2005-02-09 19:35:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stevenj@fftw.org 2005-02-09 17:11:08 UTC
The code below, when compiled by "gcc -O3 -msse", gives the following
error (same code compiles fine in gcc 3.3.5):

bug2.c: In function 'main':
bug2.c:17: error: Invalid reference prefix.
&fooD.1292;

bug2.c:17: internal compiler error: verify_stmts failed.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Environment:
System: Linux fftw.org 2.6.3-1-686-smp #2 SMP Tue Feb 24 20:29:08 EST 2004 i686 GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --prefix=/home/stevenj/gcc4

How-To-Repeat:

Compile the following code with 'gcc -O3 -msse -o bug2 bug2.c'

typedef float V __attribute__ ((vector_size (16)));
union fvec {
     float f[4];
     V v;
};

typedef unsigned int uintptr_t;
#define ALIGNMENT 8
#define TAINT_BIT 1
#define PTRINT(p) ((uintptr_t)(p))
#define ALIGNED(p) \
  (((PTRINT(p) % ALIGNMENT) == 0) && !(PTRINT(p) & TAINT_BIT))

const union fvec foo = {{-0.0, 0.0, -0.0, 0.0}};

int main(void)
{
     return !ALIGNED(&foo);
}
Comment 1 Andrew Pinski 2005-02-09 19:35:38 UTC
Confirmed, this is werid, what are the sematics of BIT_FIELD_REF.
Here is the reduced testcase:
union fvec { };
typedef __SIZE_TYPE__ uintptr_t;
union fvec foo;
int main(void)
{
     return !(((((uintptr_t)(&foo)) & 3 ) == 0) && !(((uintptr_t)(&foo)) & 1));
}
Comment 2 Jakub Jelinek 2005-02-11 09:59:03 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00450.html>
Comment 3 CVS Commits 2005-02-11 21:08:50 UTC
Subject: Bug 19858

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2005-02-11 21:08:44

Modified files:
	gcc            : ChangeLog fold-const.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.c-torture/compile: 20050210-1.c 

Log message:
	PR middle-end/19858
	* fold-const.c (make_bit_field_ref): If bitpos == 0 and bitsize
	is number of inner's bits, avoid creating a BIT_FIELD_REF.
	
	* gcc.c-torture/compile/20050210-1.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7449&r2=2.7450
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.504&r2=1.505
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5017&r2=1.5018
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20050210-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 4 Andrew Pinski 2005-02-11 21:16:54 UTC
Fixed.