diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0253-2011-05-11-Tobias-Burnus-burnus-net-b.de.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0253-2011-05-11-Tobias-Burnus-burnus-net-b.de.patch | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0253-2011-05-11-Tobias-Burnus-burnus-net-b.de.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0253-2011-05-11-Tobias-Burnus-burnus-net-b.de.patch new file mode 100644 index 0000000000..e5ab1d41ef --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0253-2011-05-11-Tobias-Burnus-burnus-net-b.de.patch | |||
@@ -0,0 +1,159 @@ | |||
1 | From 48167dc2032887845cf3ca5570c783bb38e3b930 Mon Sep 17 00:00:00 2001 | ||
2 | From: burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 11 May 2011 20:31:14 +0000 | ||
4 | Subject: [PATCH] 2011-05-11 Tobias Burnus <burnus@net-b.de> | ||
5 | |||
6 | PR fortran/48889 | ||
7 | * expr.c (gfc_is_constant_expr): Use e->value.function.esym | ||
8 | instead of e->symtree->n.sym, if available. | ||
9 | |||
10 | 2011-05-11 Tobias Burnus <burnus@net-b.de> | ||
11 | |||
12 | PR fortran/48889 | ||
13 | * gfortran.dg/generic_24.f90: New. | ||
14 | |||
15 | |||
16 | |||
17 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173675 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
18 | |||
19 | index cfa1d57..76272c4 100644 | ||
20 | --- a/gcc/fortran/expr.c | ||
21 | +++ b/gcc/fortran/expr.c | ||
22 | @@ -894,6 +894,9 @@ gfc_is_constant_expr (gfc_expr *e) | ||
23 | case EXPR_FUNCTION: | ||
24 | case EXPR_PPC: | ||
25 | case EXPR_COMPCALL: | ||
26 | + gcc_assert (e->symtree || e->value.function.esym | ||
27 | + || e->value.function.isym); | ||
28 | + | ||
29 | /* Call to intrinsic with at least one argument. */ | ||
30 | if (e->value.function.isym && e->value.function.actual) | ||
31 | { | ||
32 | @@ -902,13 +905,14 @@ gfc_is_constant_expr (gfc_expr *e) | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | - /* Make sure we have a symbol. */ | ||
37 | - gcc_assert (e->symtree); | ||
38 | - | ||
39 | - sym = e->symtree->n.sym; | ||
40 | - | ||
41 | /* Specification functions are constant. */ | ||
42 | /* F95, 7.1.6.2; F2003, 7.1.7 */ | ||
43 | + sym = NULL; | ||
44 | + if (e->symtree) | ||
45 | + sym = e->symtree->n.sym; | ||
46 | + if (e->value.function.esym) | ||
47 | + sym = e->value.function.esym; | ||
48 | + | ||
49 | if (sym | ||
50 | && sym->attr.function | ||
51 | && sym->attr.pure | ||
52 | new file mode 100644 | ||
53 | index 0000000..2388722 | ||
54 | --- /dev/null | ||
55 | +++ b/gcc/testsuite/gfortran.dg/generic_24.f90 | ||
56 | @@ -0,0 +1,100 @@ | ||
57 | +! { dg-do compile } | ||
58 | +! | ||
59 | +! PR fortran/48889 | ||
60 | +! | ||
61 | +! Thanks for | ||
62 | +! reporting to Lawrence Mitchell | ||
63 | +! for the test case to David Ham | ||
64 | +! | ||
65 | +module sparse_tools | ||
66 | + implicit none | ||
67 | + private | ||
68 | + | ||
69 | + type csr_foo | ||
70 | + integer, dimension(:), pointer :: colm=>null() | ||
71 | + end type csr_foo | ||
72 | + | ||
73 | + type block_csr_matrix | ||
74 | + type(csr_foo) :: sparsity | ||
75 | + end type block_csr_matrix | ||
76 | + | ||
77 | + interface attach_block | ||
78 | + module procedure block_csr_attach_block | ||
79 | + end interface | ||
80 | + | ||
81 | + interface size | ||
82 | + module procedure sparsity_size | ||
83 | + end interface | ||
84 | + | ||
85 | + public :: size, attach_block | ||
86 | +contains | ||
87 | + subroutine block_csr_attach_block(matrix, val) | ||
88 | + type(block_csr_matrix), intent(inout) :: matrix | ||
89 | + real, dimension(size(matrix%sparsity%colm)), intent(in), target :: val | ||
90 | + end subroutine block_csr_attach_block | ||
91 | + | ||
92 | + pure function sparsity_size(sparsity, dim) | ||
93 | + integer :: sparsity_size | ||
94 | + type(csr_foo), intent(in) :: sparsity | ||
95 | + integer, optional, intent(in) :: dim | ||
96 | + end function sparsity_size | ||
97 | +end module sparse_tools | ||
98 | + | ||
99 | +module global_numbering | ||
100 | + use sparse_tools | ||
101 | + implicit none | ||
102 | + | ||
103 | + type ele_numbering_type | ||
104 | + integer :: boundaries | ||
105 | + end type ele_numbering_type | ||
106 | + | ||
107 | + type element_type | ||
108 | + integer :: loc | ||
109 | + type(ele_numbering_type), pointer :: numbering=>null() | ||
110 | + end type element_type | ||
111 | + | ||
112 | + type csr_sparsity | ||
113 | + end type csr_sparsity | ||
114 | + | ||
115 | + interface size | ||
116 | + module procedure sparsity_size | ||
117 | + end interface size | ||
118 | +contains | ||
119 | + pure function sparsity_size(sparsity, dim) | ||
120 | + integer :: sparsity_size | ||
121 | + type(csr_sparsity), intent(in) :: sparsity | ||
122 | + integer, optional, intent(in) :: dim | ||
123 | + end function sparsity_size | ||
124 | + | ||
125 | + subroutine make_boundary_numbering(EEList, xndglno, ele_n) | ||
126 | + type(csr_sparsity), intent(in) :: EEList | ||
127 | + type(element_type), intent(in) :: ele_n | ||
128 | + integer, dimension(size(EEList,1)*ele_n%loc), intent(in), target ::& | ||
129 | + & xndglno | ||
130 | + integer, dimension(ele_n%numbering%boundaries) :: neigh | ||
131 | + integer :: j | ||
132 | + j=size(neigh) | ||
133 | + end subroutine make_boundary_numbering | ||
134 | +end module global_numbering | ||
135 | + | ||
136 | +module sparse_matrices_fields | ||
137 | + use sparse_tools | ||
138 | +implicit none | ||
139 | + type scalar_field | ||
140 | + real, dimension(:), pointer :: val | ||
141 | + end type scalar_field | ||
142 | +contains | ||
143 | + subroutine csr_mult_T_scalar(x) | ||
144 | + type(scalar_field), intent(inout) :: x | ||
145 | + real, dimension(:), allocatable :: tmp | ||
146 | + integer :: i | ||
147 | + i=size(x%val) | ||
148 | + end subroutine csr_mult_T_scalar | ||
149 | +end module sparse_matrices_fields | ||
150 | + | ||
151 | +program test | ||
152 | + use sparse_matrices_fields | ||
153 | + use global_numbering | ||
154 | +end program test | ||
155 | + | ||
156 | +! { dg-final { cleanup-modules "sparse_tools sparse_matrices_fields global_numbering" } } | ||
157 | -- | ||
158 | 1.7.0.4 | ||
159 | |||