Bug 13475 - [3.3 Regression] ICE on SIMD variables with partial value initialization
Summary: [3.3 Regression] ICE on SIMD variables with partial value initialization
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: 3.3.3
Assignee: Andrew Pinski
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-12-23 04:12 UTC by gandalf
Modified: 2003-12-23 18:41 UTC (History)
1 user (show)

See Also:
Host: i686-linux-gnu
Target: i686-linux-gnu
Build: i686-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-12-23 05:06:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gandalf 2003-12-23 04:12:30 UTC
The following code crashes the GCC 3.3.2 compiler when variable 'a' is
initialized with an incomplete list of values. Normally, the rest of the values
in a structure are assumed to be zeroed if left unspecified. The compiler does
not crash if the {1} below is edited to a {0}. The crash appears to happen
regardless of the -march or -mcpu setting.


typedef int v8qi __attribute__((mode(V8QI)));

int main()
{
  v8qi a={1};
}


Compiling displays the following:

simd.c: In function `main':
simd.c:5: warning: unused variable `a'
simd.c:5: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2003-12-23 05:06:34 UTC
Confirmed, A regression from 3.3.
From Phil's regression hunter: Search converges between 2003-07-24-3.3 (#174) and 2003-07
-25-3.3 (#175).
Patch which caused this: <http://gcc.gnu.org/ml/gcc-patches/2003-07/msg02401.html>.

Fixed on the mainline: Search converges between 2003-06-19-trunk (#318) and 2003-06-20-
trunk (#319).

Patch which fixed it on the mainline: <http://gcc.gnu.org/ml/gcc-patches/2003-06/
msg02231.html>.
I will take care of back porting this patch (it is a small one).
Comment 2 GCC Commits 2003-12-23 18:41:03 UTC
Subject: Bug 13475

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	pinskia@gcc.gnu.org	2003-12-23 18:41:00

Modified files:
	gcc            : expr.c ChangeLog 

Log message:
	2003-12-23  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR middle-end/13475
	Backport from mainline:
	2003-06-19  Aldy Hernandez  <aldyh@redhat.com>
	
	* expr.c (const_vector_from_tree): Initialize remaining elements
	to 0.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.498.2.23&r2=1.498.2.24
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.859&r2=1.16114.2.860

Comment 3 Andrew Pinski 2003-12-23 18:41:56 UTC
Fixed.