aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-11 17:15:48 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-05-11 15:15:48 +0000
commit1aa1419556f53e401b1ba132a3dc500947141a45 (patch)
tree220e3acd3a6863dda6117e518abafed885f7adac /gcc
parentf088f0aee27fbfbc2dd4c5fb73af24f12910418c (diff)
downloadgcc-1aa1419556f53e401b1ba132a3dc500947141a45.zip
gcc-1aa1419556f53e401b1ba132a3dc500947141a45.tar.gz
gcc-1aa1419556f53e401b1ba132a3dc500947141a45.tar.bz2
re PR tree-optimization/44063 (build broken for libgcc cris-elf, ICE in cgraph_estimate_size_after_inlining, at ipa-inline)
PR tree-optimize/44063 * ipa-inline.c (cgraph_edge_badness): Move always inlines to top of queue. (cgraph_decide_inlining_of_small_function): Skip check when disrgarding limits. (estimate_function_body_sizes): Compute sizes even when disregarding. * gcc.c-torture/compile/pr44063.c: New testcase. From-SVN: r159273
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/ipa-inline.c22
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44063.c38
4 files changed, 59 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 92220ec..70e5809 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-11 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimize/44063
+ * ipa-inline.c (cgraph_edge_badness): Move always inlines to top of queue.
+ (cgraph_decide_inlining_of_small_function): Skip check when disrgarding
+ limits.
+ (estimate_function_body_sizes): Compute sizes even when disregarding.
+
2010-05-11 Kai Tietz <kai.tietz@onevision.com>
* collect2.c (maybe_lto_object_file): Add x64-coff magic and check.
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 8b73210..6f189a6 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -541,6 +541,9 @@ cgraph_edge_badness (struct cgraph_edge *edge, bool dump)
(cgraph_estimate_size_after_inlining (1, edge->caller, edge->callee)
- edge->caller->global.size);
+ if (edge->callee->local.disregard_inline_limits)
+ return INT_MIN;
+
if (dump)
{
fprintf (dump_file, " Badness calculcation for %s -> %s\n",
@@ -1068,12 +1071,14 @@ cgraph_decide_inlining_of_small_functions (void)
}
}
- if (!cgraph_maybe_hot_edge_p (edge))
+ if (edge->callee->local.disregard_inline_limits)
+ ;
+ else if (!cgraph_maybe_hot_edge_p (edge))
not_good = CIF_UNLIKELY_CALL;
- if (!flag_inline_functions
+ else if (!flag_inline_functions
&& !DECL_DECLARED_INLINE_P (edge->callee->decl))
not_good = CIF_NOT_DECLARED_INLINED;
- if (optimize_function_for_size_p (DECL_STRUCT_FUNCTION(edge->caller->decl)))
+ else if (optimize_function_for_size_p (DECL_STRUCT_FUNCTION(edge->caller->decl)))
not_good = CIF_OPTIMIZING_FOR_SIZE;
if (not_good && growth > 0 && cgraph_estimate_growth (edge->callee) > 0)
{
@@ -1833,17 +1838,6 @@ estimate_function_body_sizes (struct cgraph_node *node)
int freq;
tree funtype = TREE_TYPE (node->decl);
- if (node->local.disregard_inline_limits)
- {
- if (dump_file)
- fprintf (dump_file, "Disregarding inline limits.\n");
- inline_summary (node)->self_time = 0;
- inline_summary (node)->self_size = 0;
- inline_summary (node)->time_inlining_benefit = 0;
- inline_summary (node)->size_inlining_benefit = 0;
- return;
- }
-
if (dump_file)
fprintf (dump_file, "Analyzing function body size: %s\n",
cgraph_node_name (node));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6035e5a..c664140 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-11 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimize/44063
+ * gcc.c-torture/compile/pr44063.c: New testcase.
+
2010-05-11 Jakub Jelinek <jakub@redhat.com>
PR debug/44023
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44063.c b/gcc/testsuite/gcc.c-torture/compile/pr44063.c
new file mode 100644
index 0000000..596e1dc
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44063.c
@@ -0,0 +1,38 @@
+typedef signed char int8_t;
+typedef short int16_t;
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+
+union unaligned_32 {uint32_t l;} __attribute__((packed)) __attribute__((may_alias));
+static inline uint32_t NEG_USR32(uint32_t a, int8_t s){return a << (32 - s);}
+typedef struct GetBitContext { const uint8_t *buffer, *buffer_end; int index;}GetBitContext;
+typedef struct VLC {int16_t (*table)[2];} VLC;
+static __attribute__((always_inline)) inline int get_vlc2(GetBitContext *s, int16_t (*table)[2], int bits, int max_depth) {
+ unsigned int re_index= (s)->index;
+ int re_cache= 0;
+ {
+ int n, nb_bits;
+ unsigned int index;
+ index= NEG_USR32(re_cache, bits);
+ n = table[index][1];
+ if(max_depth > 1 && n < 0){
+ re_cache= bswap_32((((const union unaligned_32 *) (((const uint8_t *)(s)->buffer)+(re_index>>3)))->l)) << (re_index&0x07);
+ }
+ }
+}
+typedef struct HYuvContext{GetBitContext gb; int decorrelate; int bitstream_bpp; uint8_t *temp[3]; VLC vlc[6];} HYuvContext;
+static __attribute__((always_inline)) inline void decode_bgr_1(HYuvContext *s, int count, int decorrelate, int alpha){
+ int i;
+ int code = get_vlc2(&s->gb, s->vlc[3].table, 11, 1);
+ if(code != -1){
+ s->temp[0][4*i+0] = get_vlc2(&s->gb, s->vlc[0].table, 11, 3);
+ s->temp[0][4*i+1] = get_vlc2(&s->gb, s->vlc[1].table, 11, 3);
+ s->temp[0][4*i+2] = get_vlc2(&s->gb, s->vlc[2].table, 11, 3);
+ }
+}
+void decode_bgr_bitstream(HYuvContext *s, int count){
+ if(s->decorrelate){
+ if(s->bitstream_bpp==24) decode_bgr_1(s, count, 1, 0);
+ else decode_bgr_1(s, count, 1, 1);
+ }
+}