diff options
Diffstat (limited to 'meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-scalar-widening-pr45847.patch')
-rw-r--r-- | meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-scalar-widening-pr45847.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-scalar-widening-pr45847.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-scalar-widening-pr45847.patch new file mode 100644 index 000000000..cbe12303e --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-scalar-widening-pr45847.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | Hi, | ||
2 | |||
3 | The attached patch fixes Bugzilla 45847 | ||
4 | (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45847). When compiling | ||
5 | without -mvectorize-with-neon-quad and vectorizing scalar widening | ||
6 | operations that widen words to double words, there are no corresponding | ||
7 | vector types for DI scalar types. For this scenario, a call to | ||
8 | get_vect_type_for_scalar_type() returns NULL and an absent NULL-check | ||
9 | caused this segfault. The attached patch adds this NULL-check. Also, | ||
10 | this is consistent with all the other places where a NULL-check follows | ||
11 | a call to get_vect_type_for_scalar_type() in tree-vect-patterns.c. | ||
12 | |||
13 | Regression tested with arm-linux-gnueabi. OK? | ||
14 | |||
15 | -- | ||
16 | Tejas Belagod | ||
17 | ARM. | ||
18 | |||
19 | gcc/ | ||
20 | |||
21 | 2010-10-05 Tejas Belagod <tejas.belagod@arm.com> | ||
22 | |||
23 | * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Add NULL | ||
24 | check for vectype_out returned by get_vectype_for_scalar_type(). | ||
25 | |||
26 | testsuite/ | ||
27 | |||
28 | 2010-10-05 Tejas Belagod <tejas.belagod@arm.com> | ||
29 | |||
30 | * gcc.dg/vect/pr45847.c: New test. | ||
31 | |||
32 | Index: gcc-4.5/gcc/testsuite/gcc.dg/vect/pr45847.c | ||
33 | =================================================================== | ||
34 | --- /dev/null | ||
35 | +++ gcc-4.5/gcc/testsuite/gcc.dg/vect/pr45847.c | ||
36 | @@ -0,0 +1,15 @@ | ||
37 | +/* { dg-do compile } */ | ||
38 | + | ||
39 | + | ||
40 | +long long foo (long long *__restrict a, int *__restrict b, int *__restrict c ) | ||
41 | +{ | ||
42 | + int i; | ||
43 | + long long sum=0; | ||
44 | + for (i=0;i<256;i++) | ||
45 | + sum += (long long)b[i] * c[i]; | ||
46 | + | ||
47 | + return sum; | ||
48 | +} | ||
49 | + | ||
50 | +/* { dg-final { cleanup-tree-dump "vect" } } */ | ||
51 | + | ||
52 | Index: gcc-4.5/gcc/tree-vect-patterns.c | ||
53 | =================================================================== | ||
54 | --- gcc-4.5.orig/gcc/tree-vect-patterns.c | ||
55 | +++ gcc-4.5/gcc/tree-vect-patterns.c | ||
56 | @@ -411,6 +411,7 @@ vect_recog_widen_mult_pattern (gimple la | ||
57 | /* Check target support */ | ||
58 | vectype = get_vectype_for_scalar_type (half_type0); | ||
59 | if (!vectype | ||
60 | + || !get_vectype_for_scalar_type (type) | ||
61 | || !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt, vectype, | ||
62 | &dummy, &dummy, &dummy_code, | ||
63 | &dummy_code, &dummy_int, &dummy_vec)) | ||