Contents of /trunk/gcc/patches/gcc-9.1.0-bz90949.patch
Parent Directory | Revision Log
Revision 3371 -
(show annotations)
(download)
Tue Jul 16 21:41:02 2019 UTC (5 years, 2 months ago) by niro
File size: 2599 byte(s)
Tue Jul 16 21:41:02 2019 UTC (5 years, 2 months ago) by niro
File size: 2599 byte(s)
-gcc-9.1.0 fixes
1 | Index: gcc/testsuite/gcc.c-torture/execute/pr90949.c |
2 | =================================================================== |
3 | --- gcc/testsuite/gcc.c-torture/execute/pr90949.c (nonexistent) |
4 | +++ gcc/testsuite/gcc.c-torture/execute/pr90949.c (revision 272555) |
5 | @@ -0,0 +1,42 @@ |
6 | +void __attribute__ ((noipa, noinline)) my_puts (const char *str) { } |
7 | + |
8 | +void __attribute__ ((noipa, noinline)) my_free (void *p) { } |
9 | + |
10 | + |
11 | +struct Node |
12 | +{ |
13 | + struct Node *child; |
14 | +}; |
15 | + |
16 | +struct Node space[2] = { }; |
17 | + |
18 | +struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes) |
19 | +{ |
20 | + return &space[0]; |
21 | +} |
22 | + |
23 | +void |
24 | +walk (struct Node *module, int cleanup) |
25 | +{ |
26 | + if (module == 0) |
27 | + { |
28 | + return; |
29 | + } |
30 | + if (!cleanup) |
31 | + { |
32 | + my_puts ("No cleanup"); |
33 | + } |
34 | + walk (module->child, cleanup); |
35 | + if (cleanup) |
36 | + { |
37 | + my_free (module); |
38 | + } |
39 | +} |
40 | + |
41 | +int |
42 | +main () |
43 | +{ |
44 | + struct Node *node = my_malloc (sizeof (struct Node)); |
45 | + node->child = 0; |
46 | + walk (node, 1); |
47 | +} |
48 | Index: gcc/tree-ssa-copy.c |
49 | =================================================================== |
50 | --- gcc/tree-ssa-copy.c (revision 272554) |
51 | +++ gcc/tree-ssa-copy.c (revision 272555) |
52 | @@ -545,13 +545,12 @@ |
53 | duplicate_ssa_name_ptr_info (copy_of[i].value, |
54 | SSA_NAME_PTR_INFO (var)); |
55 | /* Points-to information is cfg insensitive, |
56 | - but alignment info might be cfg sensitive, if it |
57 | - e.g. is derived from VRP derived non-zero bits. |
58 | - So, do not copy alignment info if the two SSA_NAMEs |
59 | - aren't defined in the same basic block. */ |
60 | + but [E]VRP might record context sensitive alignment |
61 | + info, non-nullness, etc. So reset context sensitive |
62 | + info if the two SSA_NAMEs aren't defined in the same |
63 | + basic block. */ |
64 | if (var_bb != copy_of_bb) |
65 | - mark_ptr_info_alignment_unknown |
66 | - (SSA_NAME_PTR_INFO (copy_of[i].value)); |
67 | + reset_flow_sensitive_info (copy_of[i].value); |
68 | } |
69 | else if (!POINTER_TYPE_P (TREE_TYPE (var)) |
70 | && SSA_NAME_RANGE_INFO (var) |
71 | Index: gcc/tree-ssanames.c |
72 | =================================================================== |
73 | --- gcc/tree-ssanames.c (revision 272554) |
74 | +++ gcc/tree-ssanames.c (revision 272555) |
75 | @@ -820,7 +820,12 @@ |
76 | { |
77 | /* points-to info is not flow-sensitive. */ |
78 | if (SSA_NAME_PTR_INFO (name)) |
79 | - mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name)); |
80 | + { |
81 | + /* [E]VRP can derive context sensitive alignment info and |
82 | + non-nullness properties. We must reset both. */ |
83 | + mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name)); |
84 | + SSA_NAME_PTR_INFO (name)->pt.null = 1; |
85 | + } |
86 | } |
87 | else |
88 | SSA_NAME_RANGE_INFO (name) = NULL; |