diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0314-PR-lto-49123.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0314-PR-lto-49123.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0314-PR-lto-49123.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0314-PR-lto-49123.patch new file mode 100644 index 0000000000..5832175573 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0314-PR-lto-49123.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 433d639c131ead9f557814afb1f15a0b81e86143 Mon Sep 17 00:00:00 2001 | ||
2 | From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Mon, 23 May 2011 20:37:18 +0000 | ||
4 | Subject: [PATCH] PR lto/49123 | ||
5 | * fold-const.c (constant_boolean_node): If type is non-NULL, | ||
6 | use build_int_cst_type instead of build_int_cst. | ||
7 | |||
8 | * gcc.c-torture/execute/pr49123.c: New test. | ||
9 | |||
10 | |||
11 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174087 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
12 | |||
13 | index 053ae30..51be79d 100644 | ||
14 | --- a/gcc/fold-const.c | ||
15 | +++ b/gcc/fold-const.c | ||
16 | @@ -5953,8 +5953,10 @@ constant_boolean_node (int value, tree type) | ||
17 | return value ? integer_one_node : integer_zero_node; | ||
18 | else if (type == boolean_type_node) | ||
19 | return value ? boolean_true_node : boolean_false_node; | ||
20 | + else if (type) | ||
21 | + return build_int_cst_type (type, value); | ||
22 | else | ||
23 | - return build_int_cst (type, value); | ||
24 | + return build_int_cst (NULL_TREE, value); | ||
25 | } | ||
26 | |||
27 | |||
28 | new file mode 100644 | ||
29 | index 0000000..2f1f793 | ||
30 | --- /dev/null | ||
31 | +++ b/gcc/testsuite/gcc.c-torture/execute/pr49123.c | ||
32 | @@ -0,0 +1,14 @@ | ||
33 | +/* PR lto/49123 */ | ||
34 | + | ||
35 | +extern void abort (void); | ||
36 | +static struct S { int f : 1; } s; | ||
37 | +static int v = -1; | ||
38 | + | ||
39 | +int | ||
40 | +main () | ||
41 | +{ | ||
42 | + s.f = v < 0; | ||
43 | + if ((unsigned int) s.f != -1U) | ||
44 | + abort (); | ||
45 | + return 0; | ||
46 | +} | ||
47 | -- | ||
48 | 1.7.0.4 | ||
49 | |||