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
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
Keywords: ice-on-valid-code, patch
Depends on: 19857
  Show dependency treegraph
Reported: 2005-02-09 17:11 UTC by
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


Note You need to log in before you can comment on or make changes to this bug.
Description 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.

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

System: Linux 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


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: <>
Comment 3 CVS Commits 2005-02-11 21:08:50 UTC
Subject: Bug 19858

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	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.


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