4.4.1-1
This commit is contained in:
parent
347f29eadb
commit
7274853965
@ -1 +1 @@
|
||||
gcc-4.4.0-20090319.tar.bz2
|
||||
gcc-4.4.1-20090818.tar.bz2
|
||||
|
||||
2832
gcc44-atom.patch
2832
gcc44-atom.patch
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
||||
--- libada/Makefile.in.jj 2009-01-14 12:07:35.000000000 +0100
|
||||
+++ libada/Makefile.in 2009-01-15 14:25:33.000000000 +0100
|
||||
@@ -66,17 +66,39 @@ target_noncanonical:=@target_noncanonica
|
||||
version := $(shell cat $(srcdir)/../gcc/BASE-VER)
|
||||
@@ -67,17 +67,39 @@ version := $(shell cat $(srcdir)/../gcc/
|
||||
libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
|
||||
ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
|
||||
|
||||
+DEFAULTMULTIFLAGS :=
|
||||
+ifeq ($(MULTISUBDIR),)
|
||||
@ -43,7 +43,7 @@
|
||||
"TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \
|
||||
"THREAD_KIND=$(THREAD_KIND)" \
|
||||
"TRACE=$(TRACE)" \
|
||||
@@ -87,7 +109,7 @@ LIBADA_FLAGS_TO_PASS = \
|
||||
@@ -88,7 +110,7 @@ LIBADA_FLAGS_TO_PASS = \
|
||||
"exeext=.exeext.should.not.be.used " \
|
||||
'CC=the.host.compiler.should.not.be.needed' \
|
||||
"GCC_FOR_TARGET=$(CC)" \
|
||||
|
||||
47
gcc44-libstdc++-docs.patch
Normal file
47
gcc44-libstdc++-docs.patch
Normal file
@ -0,0 +1,47 @@
|
||||
--- libstdc++-v3/doc/html/index.html 2009-01-14 12:06:37.000000000 +0100
|
||||
+++ libstdc++-v3/doc/html/index.html 2009-05-06 09:17:30.000000000 +0200
|
||||
@@ -12,7 +12,8 @@
|
||||
<div>
|
||||
<h1>The GNU C++ Library Documentation</h1>
|
||||
|
||||
-<p>Copyright 2008 FSF</p>
|
||||
+<p>Release 4.4.0</p>
|
||||
+<p>Copyright 2008, 2009 FSF</p>
|
||||
|
||||
<p>
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
--- libstdc++-v3/doc/html/api.html 2009-04-20 21:21:15.000000000 +0200
|
||||
+++ libstdc++-v3/doc/html/api.html 2009-05-06 09:17:24.000000000 +0200
|
||||
@@ -17,27 +17,12 @@ useful for examining the signatures of p
|
||||
the library classes, finding out what is in a particular include
|
||||
file, looking at inheritance diagrams, etc.
|
||||
</p><p>
|
||||
-The source-level documentation for the most recent releases can be
|
||||
-viewed online:
|
||||
-</p><div class="itemizedlist"><ul type="disc"><li><p>
|
||||
- <a class="ulink" href="libstdc++-html-USERS-3.4/index.html" target="_top">for the 3.4 release
|
||||
+The source-level documentation can be viewed here:
|
||||
+</p>
|
||||
+<div class="itemizedlist"><ul type="disc">
|
||||
+ <li><p>
|
||||
+ <a class="ulink" href="api/index.html" target="_top">for the 4.4 release
|
||||
</a>
|
||||
- </p></li><li><p>
|
||||
- <a class="ulink" href="libstdc++-html-USERS-4.1/index.html" target="_top">for the 4.1 release
|
||||
- </a>
|
||||
- </p></li><li><p>
|
||||
- <a class="ulink" href="libstdc++-html-USERS-4.2/index.html" target="_top">for the 4.2 release
|
||||
- </a>
|
||||
- </p></li><li><p>
|
||||
- <a class="ulink" href="libstdc++-html-USERS-4.3/index.html" target="_top">for the 4.3 release
|
||||
- </a>
|
||||
- </p></li><li><p>
|
||||
- <a class="ulink" href="libstdc++-html-USERS-4.4/index.html" target="_top">for the 4.4 release
|
||||
- </a>
|
||||
- </p></li><li><p>
|
||||
- <a class="ulink" href="latest-doxygen/index.html" target="_top">"the latest collection"
|
||||
- </a>
|
||||
- (For the main development tree; see the date on the first page.)
|
||||
</p></li></ul></div><p>
|
||||
This generated HTML collection, as above, is also available for download in the libstdc++ snapshots directory at
|
||||
<code class="literal"><URL:ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/></code>.
|
||||
@ -1,128 +0,0 @@
|
||||
2009-03-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* builtins.c (fold_builtin_memory_op): Optimize memmove
|
||||
into memcpy if we can prove source and destination don't overlap.
|
||||
|
||||
* gcc.dg/memmove-2.c: New test.
|
||||
* gcc.dg/memmove-3.c: New test.
|
||||
|
||||
--- gcc/builtins.c.jj 2009-03-04 20:06:31.000000000 +0100
|
||||
+++ gcc/builtins.c 2009-03-18 18:19:28.000000000 +0100
|
||||
@@ -8882,17 +8882,74 @@ fold_builtin_memory_op (tree dest, tree
|
||||
really mandatory?
|
||||
|
||||
If either SRC is readonly or length is 1, we can use memcpy. */
|
||||
- if (dest_align && src_align
|
||||
- && (readonly_data_expr (src)
|
||||
- || (host_integerp (len, 1)
|
||||
- && (MIN (src_align, dest_align) / BITS_PER_UNIT >=
|
||||
- tree_low_cst (len, 1)))))
|
||||
+ if (!dest_align || !src_align)
|
||||
+ return NULL_TREE;
|
||||
+ if (readonly_data_expr (src)
|
||||
+ || (host_integerp (len, 1)
|
||||
+ && (MIN (src_align, dest_align) / BITS_PER_UNIT >=
|
||||
+ tree_low_cst (len, 1))))
|
||||
{
|
||||
tree fn = implicit_built_in_decls[BUILT_IN_MEMCPY];
|
||||
if (!fn)
|
||||
return NULL_TREE;
|
||||
return build_call_expr (fn, 3, dest, src, len);
|
||||
}
|
||||
+
|
||||
+ /* If *src and *dest can't overlap, optimize into memcpy as well. */
|
||||
+ srcvar = build_fold_indirect_ref (src);
|
||||
+ destvar = build_fold_indirect_ref (dest);
|
||||
+ if (srcvar && !TREE_THIS_VOLATILE (srcvar)
|
||||
+ && destvar && !TREE_THIS_VOLATILE (destvar))
|
||||
+ {
|
||||
+ tree src_base, dest_base, fn;
|
||||
+ HOST_WIDE_INT src_offset = 0, dest_offset = 0;
|
||||
+ HOST_WIDE_INT size = -1;
|
||||
+ HOST_WIDE_INT maxsize = -1;
|
||||
+
|
||||
+ src_base = srcvar;
|
||||
+ if (handled_component_p (src_base))
|
||||
+ src_base = get_ref_base_and_extent (src_base, &src_offset,
|
||||
+ &size, &maxsize);
|
||||
+ dest_base = destvar;
|
||||
+ if (handled_component_p (dest_base))
|
||||
+ dest_base = get_ref_base_and_extent (dest_base, &dest_offset,
|
||||
+ &size, &maxsize);
|
||||
+ if (host_integerp (len, 1))
|
||||
+ {
|
||||
+ maxsize = tree_low_cst (len, 1);
|
||||
+ if (maxsize
|
||||
+ > INTTYPE_MAXIMUM (HOST_WIDE_INT) / BITS_PER_UNIT)
|
||||
+ maxsize = -1;
|
||||
+ else
|
||||
+ maxsize *= BITS_PER_UNIT;
|
||||
+ }
|
||||
+ else
|
||||
+ maxsize = -1;
|
||||
+ if (SSA_VAR_P (src_base)
|
||||
+ && SSA_VAR_P (dest_base))
|
||||
+ {
|
||||
+ if (operand_equal_p (src_base, dest_base, 0)
|
||||
+ && ranges_overlap_p (src_offset, maxsize,
|
||||
+ dest_offset, maxsize))
|
||||
+ return NULL_TREE;
|
||||
+ }
|
||||
+ else if (TREE_CODE (src_base) == INDIRECT_REF
|
||||
+ && TREE_CODE (dest_base) == INDIRECT_REF)
|
||||
+ {
|
||||
+ if (! operand_equal_p (TREE_OPERAND (src_base, 0),
|
||||
+ TREE_OPERAND (dest_base, 0), 0)
|
||||
+ || ranges_overlap_p (src_offset, maxsize,
|
||||
+ dest_offset, maxsize))
|
||||
+ return NULL_TREE;
|
||||
+ }
|
||||
+ else
|
||||
+ return NULL_TREE;
|
||||
+
|
||||
+ fn = implicit_built_in_decls[BUILT_IN_MEMCPY];
|
||||
+ if (!fn)
|
||||
+ return NULL_TREE;
|
||||
+ return build_call_expr (fn, 3, dest, src, len);
|
||||
+ }
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
--- gcc/testsuite/gcc.dg/memmove-2.c.jj 2009-03-18 18:30:17.000000000 +0100
|
||||
+++ gcc/testsuite/gcc.dg/memmove-2.c 2009-03-18 18:30:49.000000000 +0100
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -fdump-tree-optimized" } */
|
||||
+/* { dg-final { scan-tree-dump-times "memmove" 0 "optimized" } } */
|
||||
+/* { dg-final { cleanup-tree-dump "optimized" } } */
|
||||
+
|
||||
+char a[40];
|
||||
+extern void bar (char *);
|
||||
+
|
||||
+void
|
||||
+foo (void)
|
||||
+{
|
||||
+ char b[10];
|
||||
+ __builtin_memmove (&a[0], &a[20], 20);
|
||||
+ __builtin_memmove (&b[1], &a[25], 9);
|
||||
+ bar (b);
|
||||
+}
|
||||
--- gcc/testsuite/gcc.dg/memmove-3.c.jj 2009-03-18 18:30:19.000000000 +0100
|
||||
+++ gcc/testsuite/gcc.dg/memmove-3.c 2009-03-18 18:31:01.000000000 +0100
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -fdump-tree-optimized" } */
|
||||
+/* { dg-final { scan-tree-dump-times "memmove" 3 "optimized" } } */
|
||||
+/* { dg-final { cleanup-tree-dump "optimized" } } */
|
||||
+
|
||||
+char a[40];
|
||||
+struct A { char a[30]; };
|
||||
+
|
||||
+void
|
||||
+foo (struct A *p, char *q, char *r)
|
||||
+{
|
||||
+ char b[10];
|
||||
+ __builtin_memmove (&a[1], &a[19], 20);
|
||||
+ __builtin_memmove (&p->a[1], &p->a[9], 10);
|
||||
+ __builtin_memmove (q, r, 9);
|
||||
+}
|
||||
1586
gcc44-power7-2.patch
1586
gcc44-power7-2.patch
File diff suppressed because it is too large
Load Diff
3523
gcc44-power7-3.patch
Normal file
3523
gcc44-power7-3.patch
Normal file
File diff suppressed because it is too large
Load Diff
4253
gcc44-power7.patch
4253
gcc44-power7.patch
File diff suppressed because it is too large
Load Diff
@ -1,16 +0,0 @@
|
||||
2006-08-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c/27898
|
||||
* gcc.dg/pr27898.c: New test.
|
||||
|
||||
--- gcc/testsuite/gcc.dg/pr27898.c.jj 2006-08-18 09:19:33.000000000 +0200
|
||||
+++ gcc/testsuite/gcc.dg/pr27898.c 2006-08-18 09:19:27.000000000 +0200
|
||||
@@ -0,0 +1,8 @@
|
||||
+/* PR c/27898 */
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "--combine" } */
|
||||
+/* { dg-additional-sources "pr27898.c" } */
|
||||
+
|
||||
+union u { struct { int i; }; };
|
||||
+
|
||||
+extern int foo (union u *);
|
||||
@ -1,19 +0,0 @@
|
||||
2007-06-01 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/32139
|
||||
* gcc.c-torture/compile/20070531-1.c: New test.
|
||||
|
||||
--- gcc/testsuite/gcc.c-torture/compile/20070531-1.c.jj 2007-05-31 13:47:22.000000000 +0200
|
||||
+++ gcc/testsuite/gcc.c-torture/compile/20070531-1.c 2007-06-01 10:57:15.000000000 +0200
|
||||
@@ -0,0 +1,11 @@
|
||||
+/* PR tree-optimization/32139 */
|
||||
+int foo (void);
|
||||
+int bar (void) __attribute__ ((const));
|
||||
+
|
||||
+int
|
||||
+test (int x)
|
||||
+{
|
||||
+ int a = (x == 10000 ? foo : bar) ();
|
||||
+ int b = (x == 10000 ? foo : bar) ();
|
||||
+ return a + b;
|
||||
+}
|
||||
@ -1,146 +0,0 @@
|
||||
2009-03-18 Dodji Seketeli <dodji@redhat.com>
|
||||
Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR debug/37959
|
||||
* dwarf2out.c (dwarf_attr_name): Handle DW_AT_explicit attribute.
|
||||
(gen_subprogram_die): When a function is explicit, generate the DW_AT_explicit
|
||||
attribute.
|
||||
* langhooks.h (struct lang_hooks_for_decls): Add function_decl_explicit_p
|
||||
langhook.
|
||||
* langhooks-def.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
|
||||
(LANG_HOOKS_DECLS): Add LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P.
|
||||
|
||||
* cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
|
||||
(cp_function_decl_explicit_p): New prototype.
|
||||
* cp-objcp-common.c (cp_function_decl_explicit_p): New function.
|
||||
|
||||
* g++.dg/debug/dwarf2/explicit-constructor.C: New test.
|
||||
|
||||
--- gcc/cp/cp-objcp-common.c.jj 2009-03-05 22:32:17.000000000 +0100
|
||||
+++ gcc/cp/cp-objcp-common.c 2009-03-18 14:31:17.000000000 +0100
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Some code common to C++ and ObjC++ front ends.
|
||||
- Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
|
||||
+ Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Ziemowit Laski <zlaski@apple.com>
|
||||
|
||||
This file is part of GCC.
|
||||
@@ -203,6 +203,16 @@ cxx_staticp (tree arg)
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
+/* Return true if DECL is explicit member function. */
|
||||
+
|
||||
+bool
|
||||
+cp_function_decl_explicit_p (tree decl)
|
||||
+{
|
||||
+ return (decl
|
||||
+ && FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node
|
||||
+ && DECL_NONCONVERTING_P (decl));
|
||||
+}
|
||||
+
|
||||
/* Stubs to keep c-opts.c happy. */
|
||||
void
|
||||
push_file_scope (void)
|
||||
--- gcc/cp/cp-objcp-common.h.jj 2009-03-02 16:21:33.000000000 +0100
|
||||
+++ gcc/cp/cp-objcp-common.h 2009-03-18 14:33:51.000000000 +0100
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Language hooks common to C++ and ObjC++ front ends.
|
||||
- Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
+ Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Ziemowit Laski <zlaski@apple.com>
|
||||
|
||||
This file is part of GCC.
|
||||
@@ -26,6 +26,8 @@ along with GCC; see the file COPYING3.
|
||||
extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
|
||||
tree, bool);
|
||||
|
||||
+extern bool cp_function_decl_explicit_p (tree decl);
|
||||
+
|
||||
/* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks
|
||||
specific to C++ or ObjC++ go in cp/cp-lang.c and objcp/objcp-lang.c,
|
||||
respectively. */
|
||||
@@ -131,6 +133,8 @@ extern tree objcp_tsubst_copy_and_build
|
||||
#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
|
||||
#undef LANG_HOOKS_GIMPLIFY_EXPR
|
||||
#define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
|
||||
+#undef LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P
|
||||
+#define LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P cp_function_decl_explicit_p
|
||||
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
|
||||
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING cxx_omp_predetermined_sharing
|
||||
#undef LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR
|
||||
--- gcc/langhooks-def.h.jj 2009-03-18 14:24:43.000000000 +0100
|
||||
+++ gcc/langhooks-def.h 2009-03-18 14:32:37.000000000 +0100
|
||||
@@ -190,6 +190,7 @@ extern tree lhd_make_node (enum tree_cod
|
||||
#define LANG_HOOKS_GLOBAL_BINDINGS_P global_bindings_p
|
||||
#define LANG_HOOKS_PUSHDECL pushdecl
|
||||
#define LANG_HOOKS_GETDECLS getdecls
|
||||
+#define LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P hook_bool_tree_false
|
||||
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl
|
||||
#define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
|
||||
#define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall
|
||||
@@ -209,6 +210,7 @@ extern tree lhd_make_node (enum tree_cod
|
||||
LANG_HOOKS_GLOBAL_BINDINGS_P, \
|
||||
LANG_HOOKS_PUSHDECL, \
|
||||
LANG_HOOKS_GETDECLS, \
|
||||
+ LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P, \
|
||||
LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, \
|
||||
LANG_HOOKS_WRITE_GLOBALS, \
|
||||
LANG_HOOKS_DECL_OK_FOR_SIBCALL, \
|
||||
--- gcc/langhooks.h.jj 2009-03-18 14:24:43.000000000 +0100
|
||||
+++ gcc/langhooks.h 2009-03-18 14:32:06.000000000 +0100
|
||||
@@ -159,6 +159,9 @@ struct lang_hooks_for_decls
|
||||
/* Returns the chain of decls so far in the current scope level. */
|
||||
tree (*getdecls) (void);
|
||||
|
||||
+ /* Returns true if DECL is explicit member function. */
|
||||
+ bool (*function_decl_explicit_p) (tree);
|
||||
+
|
||||
/* Returns true when we should warn for an unused global DECL.
|
||||
We will already have checked that it has static binding. */
|
||||
bool (*warn_unused_global) (const_tree);
|
||||
--- gcc/dwarf2out.c.jj 2009-03-18 14:24:43.000000000 +0100
|
||||
+++ gcc/dwarf2out.c 2009-03-18 14:33:04.000000000 +0100
|
||||
@@ -5599,6 +5599,8 @@ dwarf_attr_name (unsigned int attr)
|
||||
return "DW_AT_encoding";
|
||||
case DW_AT_external:
|
||||
return "DW_AT_external";
|
||||
+ case DW_AT_explicit:
|
||||
+ return "DW_AT_explicit";
|
||||
case DW_AT_frame_base:
|
||||
return "DW_AT_frame_base";
|
||||
case DW_AT_friend:
|
||||
@@ -13620,6 +13622,11 @@ gen_subprogram_die (tree decl, dw_die_re
|
||||
{
|
||||
add_AT_flag (subr_die, DW_AT_declaration, 1);
|
||||
|
||||
+ /* If this is an explicit function declaration then generate
|
||||
+ a DW_AT_explicit attribute. */
|
||||
+ if (lang_hooks.decls.function_decl_explicit_p (decl))
|
||||
+ add_AT_flag (subr_die, DW_AT_explicit, 1);
|
||||
+
|
||||
/* The first time we see a member function, it is in the context of
|
||||
the class to which it belongs. We make sure of this by emitting
|
||||
the class first. The next time is the definition, which is
|
||||
--- gcc/testsuite/g++.dg/debug/dwarf2/explicit-constructor.C.jj 2009-03-18 14:24:55.000000000 +0100
|
||||
+++ gcc/testsuite/g++.dg/debug/dwarf2/explicit-constructor.C 2009-03-18 14:24:55.000000000 +0100
|
||||
@@ -0,0 +1,19 @@
|
||||
+// Contributed by Dodji Seketeli <dodji@redhat.com>
|
||||
+// Origin: PR c++
|
||||
+// { dg-do compile }
|
||||
+// { dg-options "-O -g -dA" }
|
||||
+// { dg-final { scan-assembler-times "DW_AT_explicit" 2 } }
|
||||
+
|
||||
+struct Foo
|
||||
+{
|
||||
+ Foo () {}
|
||||
+ explicit Foo (int) {}
|
||||
+ Foo (char) {}
|
||||
+ ~Foo () {};
|
||||
+};
|
||||
+
|
||||
+void
|
||||
+bar ()
|
||||
+{
|
||||
+ Foo foo;
|
||||
+}
|
||||
@ -1,108 +0,0 @@
|
||||
2009-03-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR target/39226
|
||||
* config/rs6000/rs6000.md (andsi3_internal5_nomc,
|
||||
anddi3_internal2_nomc, anddi3_internal3_nomc): Removed.
|
||||
(booldi3_internal3): Use boolean_or_operator instead of
|
||||
boolean_operator.
|
||||
|
||||
* gcc.dg/pr39226.c: New test.
|
||||
|
||||
--- gcc/config/rs6000/rs6000.md.jj 2009-03-02 18:09:02.000000000 +0100
|
||||
+++ gcc/config/rs6000/rs6000.md 2009-03-03 10:02:37.771461086 +0100
|
||||
@@ -2999,20 +2999,6 @@
|
||||
[(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
|
||||
(set_attr "length" "8,4,4,4,8,8,8,8")])
|
||||
|
||||
-(define_insn "*andsi3_internal5_nomc"
|
||||
- [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y,??y,??y,?y")
|
||||
- (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
|
||||
- (match_operand:SI 2 "and_operand" "r,r,K,L,T"))
|
||||
- (const_int 0)))
|
||||
- (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
|
||||
- (and:SI (match_dup 1)
|
||||
- (match_dup 2)))
|
||||
- (clobber (match_scratch:CC 4 "=X,X,x,x,X"))]
|
||||
- "TARGET_64BIT && !rs6000_gen_cell_microcode"
|
||||
- "#"
|
||||
- [(set_attr "type" "compare")
|
||||
- (set_attr "length" "8,8,8,8,8")])
|
||||
-
|
||||
(define_split
|
||||
[(set (match_operand:CC 3 "cc_reg_not_micro_cr0_operand" "")
|
||||
(compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
|
||||
@@ -7684,18 +7670,6 @@
|
||||
[(set_attr "type" "compare,compare,delayed_compare,compare,compare,compare,compare,compare,compare,compare,compare,compare")
|
||||
(set_attr "length" "4,4,4,4,4,8,8,8,8,8,8,12")])
|
||||
|
||||
-(define_insn "*anddi3_internal2_nomc"
|
||||
- [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y,?y,??y,??y,?y")
|
||||
- (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r")
|
||||
- (match_operand:DI 2 "and64_2_operand" "t,r,S,K,J,t"))
|
||||
- (const_int 0)))
|
||||
- (clobber (match_scratch:DI 3 "=r,r,r,r,r,r"))
|
||||
- (clobber (match_scratch:CC 4 "=X,X,X,x,x,X"))]
|
||||
- "TARGET_64BIT && !rs6000_gen_cell_microcode"
|
||||
- "#"
|
||||
- [(set_attr "type" "delayed_compare,compare,compare,compare,compare,compare")
|
||||
- (set_attr "length" "8,8,8,8,8,12")])
|
||||
-
|
||||
(define_split
|
||||
[(set (match_operand:CC 0 "cc_reg_operand" "")
|
||||
(compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
|
||||
@@ -7747,18 +7721,6 @@
|
||||
[(set_attr "type" "compare,compare,delayed_compare,compare,compare,compare,compare,compare,compare,compare,compare,compare")
|
||||
(set_attr "length" "4,4,4,4,4,8,8,8,8,8,8,12")])
|
||||
|
||||
-(define_insn "*anddi3_internal3_nomc"
|
||||
- [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y,?y,??y,??y,?y")
|
||||
- (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r")
|
||||
- (match_operand:DI 2 "and64_2_operand" "t,r,S,K,J,t"))
|
||||
- (const_int 0)))
|
||||
- (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r")
|
||||
- (and:DI (match_dup 1) (match_dup 2)))
|
||||
- (clobber (match_scratch:CC 4 "=X,X,X,x,x,X"))]
|
||||
- "TARGET_64BIT && !rs6000_gen_cell_microcode"
|
||||
- "#"
|
||||
- [(set_attr "type" "delayed_compare,compare,compare,compare,compare,compare")
|
||||
- (set_attr "length" "8,8,8,8,8,12")])
|
||||
(define_split
|
||||
[(set (match_operand:CC 3 "cc_reg_not_micro_cr0_operand" "")
|
||||
(compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
|
||||
@@ -7915,7 +7877,7 @@
|
||||
|
||||
(define_insn "*booldi3_internal3"
|
||||
[(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
|
||||
- (compare:CC (match_operator:DI 4 "boolean_operator"
|
||||
+ (compare:CC (match_operator:DI 4 "boolean_or_operator"
|
||||
[(match_operand:DI 1 "gpc_reg_operand" "%r,r")
|
||||
(match_operand:DI 2 "gpc_reg_operand" "r,r")])
|
||||
(const_int 0)))
|
||||
--- gcc/testsuite/gcc.dg/pr39226.c.jj 2009-03-02 23:27:03.398459808 +0100
|
||||
+++ gcc/testsuite/gcc.dg/pr39226.c 2009-03-02 23:26:19.696462209 +0100
|
||||
@@ -0,0 +1,25 @@
|
||||
+/* PR target/39226 */
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2" } */
|
||||
+/* { dg-options "-O2 -mtune=cell -mminimal-toc" { target { powerpc*-*-* && lp64 } } } */
|
||||
+
|
||||
+struct A
|
||||
+{
|
||||
+ char *a;
|
||||
+ unsigned int b : 1;
|
||||
+ unsigned int c : 31;
|
||||
+};
|
||||
+
|
||||
+struct B
|
||||
+{
|
||||
+ struct A *d;
|
||||
+};
|
||||
+
|
||||
+void
|
||||
+foo (struct B *x, unsigned long y)
|
||||
+{
|
||||
+ if (x->d[y].c)
|
||||
+ return;
|
||||
+ if (x->d[y].b)
|
||||
+ x->d[y].a = 0;
|
||||
+}
|
||||
@ -3,20 +3,20 @@
|
||||
* Makefile.am (libgcj_tools_la_LIBADD): Add.
|
||||
* Makefile.in: Regenerated.
|
||||
|
||||
--- libjava/Makefile.am.jj 2007-03-17 09:20:30.000000000 +0100
|
||||
+++ libjava/Makefile.am 2007-10-16 15:45:14.000000000 +0200
|
||||
@@ -277,6 +277,8 @@ EXTRA_libgcj_la_SOURCES = java/lang/Obje
|
||||
|
||||
libgcj_tools_la_SOURCES = classpath/tools/tools.zip
|
||||
libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes -fsource-filename=$(here)/classpath/tools/all-classes.lst
|
||||
--- libjava/Makefile.am.jj 2009-05-06 08:14:50.000000000 +0200
|
||||
+++ libjava/Makefile.am 2009-05-06 10:26:43.000000000 +0200
|
||||
@@ -314,6 +314,8 @@ libgcj_tools_la_SOURCES = classpath/tool
|
||||
libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch \
|
||||
-fno-bootstrap-classes -fno-indirect-classes \
|
||||
-fsource-filename=$(here)/classpath/tools/all-classes.lst
|
||||
+## See jv_convert_LDADD.
|
||||
+libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la
|
||||
libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
|
||||
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
|
||||
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
|
||||
--- libjava/Makefile.in.jj 2007-07-04 21:11:11.000000000 +0200
|
||||
+++ libjava/Makefile.in 2007-10-16 15:56:07.000000000 +0200
|
||||
@@ -153,7 +153,6 @@ am__objects_1 = gnu/gcj/xlib/lib_gnu_awt
|
||||
--- libjava/Makefile.in.jj 2009-05-06 08:14:49.000000000 +0200
|
||||
+++ libjava/Makefile.in 2009-05-06 10:27:18.000000000 +0200
|
||||
@@ -160,7 +160,6 @@ am__objects_1 = gnu/gcj/xlib/lib_gnu_awt
|
||||
am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1)
|
||||
lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS)
|
||||
@XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir)
|
||||
@ -24,10 +24,10 @@
|
||||
am_libgcj_tools_la_OBJECTS = classpath/tools/libgcj_tools_la-tools.lo
|
||||
libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS)
|
||||
@INTERPRETER_TRUE@am__DEPENDENCIES_1 = gnu/classpath/jdwp.lo \
|
||||
@@ -941,6 +940,7 @@ libgcj_la_LINK = $(LIBLINK)
|
||||
EXTRA_libgcj_la_SOURCES = java/lang/Object.java
|
||||
libgcj_tools_la_SOURCES = classpath/tools/tools.zip
|
||||
libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes -fsource-filename=$(here)/classpath/tools/all-classes.lst
|
||||
@@ -1041,6 +1040,7 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS
|
||||
-fno-bootstrap-classes -fno-indirect-classes \
|
||||
-fsource-filename=$(here)/classpath/tools/all-classes.lst
|
||||
|
||||
+libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la
|
||||
libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
|
||||
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
|
||||
|
||||
827
gcc44-rh503816-1.patch
Normal file
827
gcc44-rh503816-1.patch
Normal file
@ -0,0 +1,827 @@
|
||||
2009-06-21 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* var-tracking.c (struct shared_hash_def, shared_hash): New types.
|
||||
(dataflow_set): Change vars type from htab_t to shared_hash.
|
||||
(shared_hash_pool, empty_shared_hash): New variables.
|
||||
(vars_clear): Removed.
|
||||
(shared_hash_shared, shared_hash_htab, shared_hash_copy,
|
||||
shared_hash_find_slot_unshare, shared_hash_find_slot,
|
||||
shared_hash_find_slot_noinsert, shared_hash_find): New
|
||||
static inlines.
|
||||
(shared_hash_unshare, shared_hash_destroy): New functions.
|
||||
(unshare_variable): Unshare set->vars if shared, use
|
||||
shared_hash_htab.
|
||||
(vars_copy): Use htab_traverse_noresize instead of htab_traverse.
|
||||
(get_init_value, find_src_set_src, dump_dataflow_set,
|
||||
clobber_variable_part, emit_notes_for_differences): Use
|
||||
shared_hash_htab.
|
||||
(dataflow_set_init): Remove second argument, set vars to
|
||||
empty_shared_hash instead of creating a new htab.
|
||||
(dataflow_set_clear): Call shared_hash_destroy and set vars
|
||||
to empty_shared_hash instead of calling vars_clear.
|
||||
(dataflow_set_copy): Don't call vars_copy, instead just share
|
||||
the src htab with dst.
|
||||
(variable_union): Use shared_hash_*, use initially NO_INSERT
|
||||
lookup if set->vars is shared. Don't keep slot cleared before
|
||||
calling unshare_variable. Unshare set->vars if needed.
|
||||
Even ->refcount == 1 vars must be unshared if set->vars is shared
|
||||
and var needs to be modified.
|
||||
(variable_canonicalize): New function.
|
||||
(dataflow_set_union): If dst->vars is empty, just share src->vars
|
||||
with dst->vars and traverse with variable_canonicalize to canonicalize
|
||||
and unshare what is needed.
|
||||
(dataflow_set_different): If old_set and new_set use the same shared
|
||||
htab, they aren't different. If number of htab elements is different,
|
||||
htabs are different. Use shared_hash_*.
|
||||
(dataflow_set_destroy): Call shared_hash_destroy instead of
|
||||
htab_delete.
|
||||
(compute_bb_dataflow, emit_notes_in_bb, vt_emit_notes): Don't pass
|
||||
second argument to dataflow_set_init.
|
||||
(vt_initialize): Likewise. Initialize shared_hash_pool and
|
||||
empty_shared_hash, move bb in/out initialization afterwards.
|
||||
Use variable_htab_free instead of NULL as changed_variables del hook.
|
||||
(variable_was_changed): Change type of second argument to pointer to
|
||||
dataflow_set. When inserting var into changed_variables, bump
|
||||
refcount. Unshare set->vars if set is shared htab and slot needs to
|
||||
be cleared.
|
||||
(set_variable_part): Use shared_hash_*, use initially NO_INSERT
|
||||
lookup if set->vars is shared. Unshare set->vars if needed.
|
||||
Even ->refcount == 1 vars must be unshared if set->vars is shared
|
||||
and var needs to be modified. Adjust variable_was_changed caller.
|
||||
(delete_variable_part): Use shared_hash_*. Even ->refcount == 1
|
||||
vars must be unshared if set->vars is shared and var needs to be
|
||||
modified. Adjust variable_was_changed caller.
|
||||
(emit_note_insn_var_location): Don't pool_free var.
|
||||
(emit_notes_for_differences_1): Initialize empty_var->refcount to 0
|
||||
instead of 1.
|
||||
(vt_finalize): Call htab_delete on empty_shared_hash->htab and
|
||||
free_alloc_pool on shared_hash_pool.
|
||||
|
||||
* hashtab.c (htab_traverse): Don't call htab_expand for
|
||||
nearly empty hashtabs with sizes 7, 13 or 31.
|
||||
|
||||
--- gcc/var-tracking.c (revision 148758)
|
||||
+++ gcc/var-tracking.c (revision 148760)
|
||||
@@ -182,6 +182,17 @@ typedef struct attrs_def
|
||||
HOST_WIDE_INT offset;
|
||||
} *attrs;
|
||||
|
||||
+/* Structure holding a refcounted hash table. If refcount > 1,
|
||||
+ it must be first unshared before modified. */
|
||||
+typedef struct shared_hash_def
|
||||
+{
|
||||
+ /* Reference count. */
|
||||
+ int refcount;
|
||||
+
|
||||
+ /* Actual hash table. */
|
||||
+ htab_t htab;
|
||||
+} *shared_hash;
|
||||
+
|
||||
/* Structure holding the IN or OUT set for a basic block. */
|
||||
typedef struct dataflow_set_def
|
||||
{
|
||||
@@ -192,7 +203,7 @@ typedef struct dataflow_set_def
|
||||
attrs regs[FIRST_PSEUDO_REGISTER];
|
||||
|
||||
/* Variable locations. */
|
||||
- htab_t vars;
|
||||
+ shared_hash vars;
|
||||
} dataflow_set;
|
||||
|
||||
/* The structure (one for each basic block) containing the information
|
||||
@@ -280,12 +291,18 @@ static alloc_pool var_pool;
|
||||
/* Alloc pool for struct location_chain_def. */
|
||||
static alloc_pool loc_chain_pool;
|
||||
|
||||
+/* Alloc pool for struct shared_hash_def. */
|
||||
+static alloc_pool shared_hash_pool;
|
||||
+
|
||||
/* Changed variables, notes will be emitted for them. */
|
||||
static htab_t changed_variables;
|
||||
|
||||
/* Shall notes be emitted? */
|
||||
static bool emit_notes;
|
||||
|
||||
+/* Empty shared hashtable. */
|
||||
+static shared_hash empty_shared_hash;
|
||||
+
|
||||
/* Local function prototypes. */
|
||||
static void stack_adjust_offset_pre_post (rtx, HOST_WIDE_INT *,
|
||||
HOST_WIDE_INT *);
|
||||
@@ -305,7 +322,6 @@ static void attrs_list_insert (attrs *,
|
||||
static void attrs_list_copy (attrs *, attrs);
|
||||
static void attrs_list_union (attrs *, attrs);
|
||||
|
||||
-static void vars_clear (htab_t);
|
||||
static variable unshare_variable (dataflow_set *set, variable var,
|
||||
enum var_init_status);
|
||||
static int vars_copy_1 (void **, void *);
|
||||
@@ -321,11 +337,12 @@ static void var_mem_delete_and_set (data
|
||||
enum var_init_status, rtx);
|
||||
static void var_mem_delete (dataflow_set *, rtx, bool);
|
||||
|
||||
-static void dataflow_set_init (dataflow_set *, int);
|
||||
+static void dataflow_set_init (dataflow_set *);
|
||||
static void dataflow_set_clear (dataflow_set *);
|
||||
static void dataflow_set_copy (dataflow_set *, dataflow_set *);
|
||||
static int variable_union_info_cmp_pos (const void *, const void *);
|
||||
static int variable_union (void **, void *);
|
||||
+static int variable_canonicalize (void **, void *);
|
||||
static void dataflow_set_union (dataflow_set *, dataflow_set *);
|
||||
static bool variable_part_different_p (variable_part *, variable_part *);
|
||||
static bool variable_different_p (variable, variable, bool);
|
||||
@@ -352,7 +369,7 @@ static void dump_vars (htab_t);
|
||||
static void dump_dataflow_set (dataflow_set *);
|
||||
static void dump_dataflow_sets (void);
|
||||
|
||||
-static void variable_was_changed (variable, htab_t);
|
||||
+static void variable_was_changed (variable, dataflow_set *);
|
||||
static void set_variable_part (dataflow_set *, rtx, tree, HOST_WIDE_INT,
|
||||
enum var_init_status, rtx);
|
||||
static void clobber_variable_part (dataflow_set *, rtx, tree, HOST_WIDE_INT,
|
||||
@@ -742,12 +759,107 @@ attrs_list_union (attrs *dstp, attrs src
|
||||
}
|
||||
}
|
||||
|
||||
-/* Delete all variables from hash table VARS. */
|
||||
+/* Shared hashtable support. */
|
||||
+
|
||||
+/* Return true if VARS is shared. */
|
||||
+
|
||||
+static inline bool
|
||||
+shared_hash_shared (shared_hash vars)
|
||||
+{
|
||||
+ return vars->refcount > 1;
|
||||
+}
|
||||
+
|
||||
+/* Return the hash table for VARS. */
|
||||
+
|
||||
+static inline htab_t
|
||||
+shared_hash_htab (shared_hash vars)
|
||||
+{
|
||||
+ return vars->htab;
|
||||
+}
|
||||
+
|
||||
+/* Copy variables into a new hash table. */
|
||||
+
|
||||
+static shared_hash
|
||||
+shared_hash_unshare (shared_hash vars)
|
||||
+{
|
||||
+ shared_hash new_vars = (shared_hash) pool_alloc (shared_hash_pool);
|
||||
+ gcc_assert (vars->refcount > 1);
|
||||
+ new_vars->refcount = 1;
|
||||
+ new_vars->htab
|
||||
+ = htab_create (htab_elements (vars->htab) + 3, variable_htab_hash,
|
||||
+ variable_htab_eq, variable_htab_free);
|
||||
+ vars_copy (new_vars->htab, vars->htab);
|
||||
+ vars->refcount--;
|
||||
+ return new_vars;
|
||||
+}
|
||||
+
|
||||
+/* Increment reference counter on VARS and return it. */
|
||||
+
|
||||
+static inline shared_hash
|
||||
+shared_hash_copy (shared_hash vars)
|
||||
+{
|
||||
+ vars->refcount++;
|
||||
+ return vars;
|
||||
+}
|
||||
+
|
||||
+/* Decrement reference counter and destroy hash table if not shared
|
||||
+ anymore. */
|
||||
|
||||
static void
|
||||
-vars_clear (htab_t vars)
|
||||
+shared_hash_destroy (shared_hash vars)
|
||||
{
|
||||
- htab_empty (vars);
|
||||
+ gcc_assert (vars->refcount > 0);
|
||||
+ if (--vars->refcount == 0)
|
||||
+ {
|
||||
+ htab_delete (vars->htab);
|
||||
+ pool_free (shared_hash_pool, vars);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* Unshare *PVARS if shared and return slot for DECL. If INS is
|
||||
+ INSERT, insert it if not already present. */
|
||||
+
|
||||
+static inline void **
|
||||
+shared_hash_find_slot_unshare (shared_hash *pvars, tree decl,
|
||||
+ enum insert_option ins)
|
||||
+{
|
||||
+ if (shared_hash_shared (*pvars))
|
||||
+ *pvars = shared_hash_unshare (*pvars);
|
||||
+ return htab_find_slot_with_hash (shared_hash_htab (*pvars), decl,
|
||||
+ VARIABLE_HASH_VAL (decl), ins);
|
||||
+}
|
||||
+
|
||||
+/* Return slot for DECL, if it is already present in the hash table.
|
||||
+ If it is not present, insert it only VARS is not shared, otherwise
|
||||
+ return NULL. */
|
||||
+
|
||||
+static inline void **
|
||||
+shared_hash_find_slot (shared_hash vars, tree decl)
|
||||
+{
|
||||
+ return htab_find_slot_with_hash (shared_hash_htab (vars), decl,
|
||||
+ VARIABLE_HASH_VAL (decl),
|
||||
+ shared_hash_shared (vars)
|
||||
+ ? NO_INSERT : INSERT);
|
||||
+}
|
||||
+
|
||||
+/* Return slot for DECL only if it is already present in the hash table. */
|
||||
+
|
||||
+static inline void **
|
||||
+shared_hash_find_slot_noinsert (shared_hash vars, tree decl)
|
||||
+{
|
||||
+ return htab_find_slot_with_hash (shared_hash_htab (vars), decl,
|
||||
+ VARIABLE_HASH_VAL (decl), NO_INSERT);
|
||||
+}
|
||||
+
|
||||
+/* Return variable for DECL or NULL if not already present in the hash
|
||||
+ table. */
|
||||
+
|
||||
+static inline variable
|
||||
+shared_hash_find (shared_hash vars, tree decl)
|
||||
+{
|
||||
+ return (variable)
|
||||
+ htab_find_with_hash (shared_hash_htab (vars), decl,
|
||||
+ VARIABLE_HASH_VAL (decl));
|
||||
}
|
||||
|
||||
/* Return a copy of a variable VAR and insert it to dataflow set SET. */
|
||||
@@ -801,9 +913,7 @@ unshare_variable (dataflow_set *set, var
|
||||
new_var->var_part[i].cur_loc = NULL;
|
||||
}
|
||||
|
||||
- slot = htab_find_slot_with_hash (set->vars, new_var->decl,
|
||||
- VARIABLE_HASH_VAL (new_var->decl),
|
||||
- INSERT);
|
||||
+ slot = shared_hash_find_slot_unshare (&set->vars, new_var->decl, INSERT);
|
||||
*slot = new_var;
|
||||
return new_var;
|
||||
}
|
||||
@@ -834,8 +944,7 @@ vars_copy_1 (void **slot, void *data)
|
||||
static void
|
||||
vars_copy (htab_t dst, htab_t src)
|
||||
{
|
||||
- vars_clear (dst);
|
||||
- htab_traverse (src, vars_copy_1, dst);
|
||||
+ htab_traverse_noresize (src, vars_copy_1, dst);
|
||||
}
|
||||
|
||||
/* Map a decl to its main debug decl. */
|
||||
@@ -874,7 +983,6 @@ var_reg_set (dataflow_set *set, rtx loc,
|
||||
static int
|
||||
get_init_value (dataflow_set *set, rtx loc, tree decl)
|
||||
{
|
||||
- void **slot;
|
||||
variable var;
|
||||
int i;
|
||||
int ret_val = VAR_INIT_STATUS_UNKNOWN;
|
||||
@@ -882,11 +990,9 @@ get_init_value (dataflow_set *set, rtx l
|
||||
if (! flag_var_tracking_uninit)
|
||||
return VAR_INIT_STATUS_INITIALIZED;
|
||||
|
||||
- slot = htab_find_slot_with_hash (set->vars, decl, VARIABLE_HASH_VAL (decl),
|
||||
- NO_INSERT);
|
||||
- if (slot)
|
||||
+ var = shared_hash_find (set->vars, decl);
|
||||
+ if (var)
|
||||
{
|
||||
- var = * (variable *) slot;
|
||||
for (i = 0; i < var->n_var_parts && ret_val == VAR_INIT_STATUS_UNKNOWN; i++)
|
||||
{
|
||||
location_chain nextp;
|
||||
@@ -1050,11 +1156,10 @@ var_mem_delete (dataflow_set *set, rtx l
|
||||
VARS_SIZE is the initial size of hash table VARS. */
|
||||
|
||||
static void
|
||||
-dataflow_set_init (dataflow_set *set, int vars_size)
|
||||
+dataflow_set_init (dataflow_set *set)
|
||||
{
|
||||
init_attrs_list_set (set->regs);
|
||||
- set->vars = htab_create (vars_size, variable_htab_hash, variable_htab_eq,
|
||||
- variable_htab_free);
|
||||
+ set->vars = shared_hash_copy (empty_shared_hash);
|
||||
set->stack_adjust = 0;
|
||||
}
|
||||
|
||||
@@ -1068,7 +1173,8 @@ dataflow_set_clear (dataflow_set *set)
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
attrs_list_clear (&set->regs[i]);
|
||||
|
||||
- vars_clear (set->vars);
|
||||
+ shared_hash_destroy (set->vars);
|
||||
+ set->vars = shared_hash_copy (empty_shared_hash);
|
||||
}
|
||||
|
||||
/* Copy the contents of dataflow set SRC to DST. */
|
||||
@@ -1081,7 +1187,8 @@ dataflow_set_copy (dataflow_set *dst, da
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
attrs_list_copy (&dst->regs[i], src->regs[i]);
|
||||
|
||||
- vars_copy (dst->vars, src->vars);
|
||||
+ shared_hash_destroy (dst->vars);
|
||||
+ dst->vars = shared_hash_copy (src->vars);
|
||||
dst->stack_adjust = src->stack_adjust;
|
||||
}
|
||||
|
||||
@@ -1129,15 +1236,14 @@ variable_union_info_cmp_pos (const void
|
||||
static int
|
||||
variable_union (void **slot, void *data)
|
||||
{
|
||||
- variable src, dst, *dstp;
|
||||
+ variable src, dst;
|
||||
+ void **dstp;
|
||||
dataflow_set *set = (dataflow_set *) data;
|
||||
int i, j, k;
|
||||
|
||||
src = *(variable *) slot;
|
||||
- dstp = (variable *) htab_find_slot_with_hash (set->vars, src->decl,
|
||||
- VARIABLE_HASH_VAL (src->decl),
|
||||
- INSERT);
|
||||
- if (!*dstp)
|
||||
+ dstp = shared_hash_find_slot (set->vars, src->decl);
|
||||
+ if (!dstp || !*dstp)
|
||||
{
|
||||
src->refcount++;
|
||||
|
||||
@@ -1162,16 +1268,23 @@ variable_union (void **slot, void *data)
|
||||
if (! flag_var_tracking_uninit)
|
||||
status = VAR_INIT_STATUS_INITIALIZED;
|
||||
|
||||
+ if (dstp)
|
||||
+ *dstp = (void *) src;
|
||||
unshare_variable (set, src, status);
|
||||
}
|
||||
else
|
||||
- *dstp = src;
|
||||
+ {
|
||||
+ if (!dstp)
|
||||
+ dstp = shared_hash_find_slot_unshare (&set->vars, src->decl,
|
||||
+ INSERT);
|
||||
+ *dstp = (void *) src;
|
||||
+ }
|
||||
|
||||
/* Continue traversing the hash table. */
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
- dst = *dstp;
|
||||
+ dst = (variable) *dstp;
|
||||
|
||||
gcc_assert (src->n_var_parts);
|
||||
|
||||
@@ -1196,7 +1309,8 @@ variable_union (void **slot, void *data)
|
||||
thus there are at most MAX_VAR_PARTS different offsets. */
|
||||
gcc_assert (k <= MAX_VAR_PARTS);
|
||||
|
||||
- if (dst->refcount > 1 && dst->n_var_parts != k)
|
||||
+ if ((dst->refcount > 1 || shared_hash_shared (set->vars))
|
||||
+ && dst->n_var_parts != k)
|
||||
{
|
||||
enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
||||
|
||||
@@ -1226,7 +1340,7 @@ variable_union (void **slot, void *data)
|
||||
/* If DST is shared compare the location chains.
|
||||
If they are different we will modify the chain in DST with
|
||||
high probability so make a copy of DST. */
|
||||
- if (dst->refcount > 1)
|
||||
+ if (dst->refcount > 1 || shared_hash_shared (set->vars))
|
||||
{
|
||||
for (node = src->var_part[i].loc_chain,
|
||||
node2 = dst->var_part[j].loc_chain; node && node2;
|
||||
@@ -1379,6 +1493,46 @@ variable_union (void **slot, void *data)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+/* Like variable_union, but only used when doing dataflow_set_union
|
||||
+ into an empty hashtab. To allow sharing, dst is initially shared
|
||||
+ with src (so all variables are "copied" from src to dst hashtab),
|
||||
+ so only unshare_variable for variables that need canonicalization
|
||||
+ are needed. */
|
||||
+
|
||||
+static int
|
||||
+variable_canonicalize (void **slot, void *data)
|
||||
+{
|
||||
+ variable src;
|
||||
+ dataflow_set *set = (dataflow_set *) data;
|
||||
+ int k;
|
||||
+
|
||||
+ src = *(variable *) slot;
|
||||
+
|
||||
+ /* If CUR_LOC of some variable part is not the first element of
|
||||
+ the location chain we are going to change it so we have to make
|
||||
+ a copy of the variable. */
|
||||
+ for (k = 0; k < src->n_var_parts; k++)
|
||||
+ {
|
||||
+ gcc_assert (!src->var_part[k].loc_chain == !src->var_part[k].cur_loc);
|
||||
+ if (src->var_part[k].loc_chain)
|
||||
+ {
|
||||
+ gcc_assert (src->var_part[k].cur_loc);
|
||||
+ if (src->var_part[k].cur_loc != src->var_part[k].loc_chain->loc)
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (k < src->n_var_parts)
|
||||
+ {
|
||||
+ enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
||||
+
|
||||
+ if (! flag_var_tracking_uninit)
|
||||
+ status = VAR_INIT_STATUS_INITIALIZED;
|
||||
+
|
||||
+ unshare_variable (set, src, status);
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
/* Compute union of dataflow sets SRC and DST and store it to DST. */
|
||||
|
||||
static void
|
||||
@@ -1389,7 +1543,14 @@ dataflow_set_union (dataflow_set *dst, d
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
attrs_list_union (&dst->regs[i], src->regs[i]);
|
||||
|
||||
- htab_traverse (src->vars, variable_union, dst);
|
||||
+ if (dst->vars == empty_shared_hash)
|
||||
+ {
|
||||
+ shared_hash_destroy (dst->vars);
|
||||
+ dst->vars = shared_hash_copy (src->vars);
|
||||
+ htab_traverse (shared_hash_htab (src->vars), variable_canonicalize, dst);
|
||||
+ }
|
||||
+ else
|
||||
+ htab_traverse (shared_hash_htab (src->vars), variable_union, dst);
|
||||
}
|
||||
|
||||
/* Flag whether two dataflow sets being compared contain different data. */
|
||||
@@ -1522,15 +1683,24 @@ dataflow_set_different_2 (void **slot, v
|
||||
static bool
|
||||
dataflow_set_different (dataflow_set *old_set, dataflow_set *new_set)
|
||||
{
|
||||
+ if (old_set->vars == new_set->vars)
|
||||
+ return false;
|
||||
+
|
||||
+ if (htab_elements (shared_hash_htab (old_set->vars))
|
||||
+ != htab_elements (shared_hash_htab (new_set->vars)))
|
||||
+ return true;
|
||||
+
|
||||
dataflow_set_different_value = false;
|
||||
|
||||
- htab_traverse (old_set->vars, dataflow_set_different_1, new_set->vars);
|
||||
+ htab_traverse (shared_hash_htab (old_set->vars), dataflow_set_different_1,
|
||||
+ shared_hash_htab (new_set->vars));
|
||||
if (!dataflow_set_different_value)
|
||||
{
|
||||
/* We have compared the variables which are in both hash tables
|
||||
so now only check whether there are some variables in NEW_SET->VARS
|
||||
which are not in OLD_SET->VARS. */
|
||||
- htab_traverse (new_set->vars, dataflow_set_different_2, old_set->vars);
|
||||
+ htab_traverse (shared_hash_htab (new_set->vars), dataflow_set_different_2,
|
||||
+ shared_hash_htab (old_set->vars));
|
||||
}
|
||||
return dataflow_set_different_value;
|
||||
}
|
||||
@@ -1545,7 +1715,7 @@ dataflow_set_destroy (dataflow_set *set)
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
attrs_list_clear (&set->regs[i]);
|
||||
|
||||
- htab_delete (set->vars);
|
||||
+ shared_hash_destroy (set->vars);
|
||||
set->vars = NULL;
|
||||
}
|
||||
|
||||
@@ -1985,7 +2155,6 @@ find_src_set_src (dataflow_set *set, rtx
|
||||
{
|
||||
tree decl = NULL_TREE; /* The variable being copied around. */
|
||||
rtx set_src = NULL_RTX; /* The value for "decl" stored in "src". */
|
||||
- void **slot;
|
||||
variable var;
|
||||
location_chain nextp;
|
||||
int i;
|
||||
@@ -1998,12 +2167,9 @@ find_src_set_src (dataflow_set *set, rtx
|
||||
|
||||
if (src && decl)
|
||||
{
|
||||
- slot = htab_find_slot_with_hash (set->vars, decl,
|
||||
- VARIABLE_HASH_VAL (decl), NO_INSERT);
|
||||
-
|
||||
- if (slot)
|
||||
+ var = shared_hash_find (set->vars, decl);
|
||||
+ if (var)
|
||||
{
|
||||
- var = *(variable *) slot;
|
||||
found = false;
|
||||
for (i = 0; i < var->n_var_parts && !found; i++)
|
||||
for (nextp = var->var_part[i].loc_chain; nextp && !found;
|
||||
@@ -2031,7 +2197,7 @@ compute_bb_dataflow (basic_block bb)
|
||||
dataflow_set *in = &VTI (bb)->in;
|
||||
dataflow_set *out = &VTI (bb)->out;
|
||||
|
||||
- dataflow_set_init (&old_out, htab_elements (VTI (bb)->out.vars) + 3);
|
||||
+ dataflow_set_init (&old_out);
|
||||
dataflow_set_copy (&old_out, out);
|
||||
dataflow_set_copy (out, in);
|
||||
|
||||
@@ -2323,7 +2489,7 @@ dump_dataflow_set (dataflow_set *set)
|
||||
dump_attrs_list (set->regs[i]);
|
||||
}
|
||||
}
|
||||
- dump_vars (set->vars);
|
||||
+ dump_vars (shared_hash_htab (set->vars));
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
|
||||
@@ -2345,10 +2511,10 @@ dump_dataflow_sets (void)
|
||||
}
|
||||
|
||||
/* Add variable VAR to the hash table of changed variables and
|
||||
- if it has no locations delete it from hash table HTAB. */
|
||||
+ if it has no locations delete it from SET's hash table. */
|
||||
|
||||
static void
|
||||
-variable_was_changed (variable var, htab_t htab)
|
||||
+variable_was_changed (variable var, dataflow_set *set)
|
||||
{
|
||||
hashval_t hash = VARIABLE_HASH_VAL (var->decl);
|
||||
|
||||
@@ -2359,36 +2525,39 @@ variable_was_changed (variable var, htab
|
||||
slot = (variable *) htab_find_slot_with_hash (changed_variables,
|
||||
var->decl, hash, INSERT);
|
||||
|
||||
- if (htab && var->n_var_parts == 0)
|
||||
+ if (set && var->n_var_parts == 0)
|
||||
{
|
||||
variable empty_var;
|
||||
- void **old;
|
||||
|
||||
empty_var = (variable) pool_alloc (var_pool);
|
||||
empty_var->decl = var->decl;
|
||||
empty_var->refcount = 1;
|
||||
empty_var->n_var_parts = 0;
|
||||
*slot = empty_var;
|
||||
-
|
||||
- old = htab_find_slot_with_hash (htab, var->decl, hash,
|
||||
- NO_INSERT);
|
||||
- if (old)
|
||||
- htab_clear_slot (htab, old);
|
||||
+ goto drop_var;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ var->refcount++;
|
||||
*slot = var;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
- gcc_assert (htab);
|
||||
+ gcc_assert (set);
|
||||
if (var->n_var_parts == 0)
|
||||
{
|
||||
- void **slot = htab_find_slot_with_hash (htab, var->decl, hash,
|
||||
- NO_INSERT);
|
||||
+ void **slot;
|
||||
+
|
||||
+ drop_var:
|
||||
+ slot = shared_hash_find_slot_noinsert (set->vars, var->decl);
|
||||
if (slot)
|
||||
- htab_clear_slot (htab, slot);
|
||||
+ {
|
||||
+ if (shared_hash_shared (set->vars))
|
||||
+ slot = shared_hash_find_slot_unshare (&set->vars, var->decl,
|
||||
+ NO_INSERT);
|
||||
+ htab_clear_slot (shared_hash_htab (set->vars), slot);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2438,12 +2607,12 @@ set_variable_part (dataflow_set *set, rt
|
||||
location_chain node, next;
|
||||
location_chain *nextp;
|
||||
variable var;
|
||||
- void **slot;
|
||||
-
|
||||
- slot = htab_find_slot_with_hash (set->vars, decl,
|
||||
- VARIABLE_HASH_VAL (decl), INSERT);
|
||||
- if (!*slot)
|
||||
+ void **slot = shared_hash_find_slot (set->vars, decl);
|
||||
+
|
||||
+ if (!slot || !*slot)
|
||||
{
|
||||
+ if (!slot)
|
||||
+ slot = shared_hash_find_slot_unshare (&set->vars, decl, INSERT);
|
||||
/* Create new variable information. */
|
||||
var = (variable) pool_alloc (var_pool);
|
||||
var->decl = decl;
|
||||
@@ -2479,13 +2648,12 @@ set_variable_part (dataflow_set *set, rt
|
||||
if (set_src != NULL)
|
||||
node->set_src = set_src;
|
||||
|
||||
- *slot = var;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have to make a copy of a shared variable. */
|
||||
- if (var->refcount > 1)
|
||||
+ if (var->refcount > 1 || shared_hash_shared (set->vars))
|
||||
var = unshare_variable (set, var, initialized);
|
||||
}
|
||||
}
|
||||
@@ -2494,7 +2662,7 @@ set_variable_part (dataflow_set *set, rt
|
||||
/* We have not found the location part, new one will be created. */
|
||||
|
||||
/* We have to make a copy of the shared variable. */
|
||||
- if (var->refcount > 1)
|
||||
+ if (var->refcount > 1 || shared_hash_shared (set->vars))
|
||||
var = unshare_variable (set, var, initialized);
|
||||
|
||||
/* We track only variables whose size is <= MAX_VAR_PARTS bytes
|
||||
@@ -2548,7 +2716,7 @@ set_variable_part (dataflow_set *set, rt
|
||||
if (var->var_part[pos].cur_loc == NULL)
|
||||
{
|
||||
var->var_part[pos].cur_loc = loc;
|
||||
- variable_was_changed (var, set->vars);
|
||||
+ variable_was_changed (var, set);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2561,16 +2729,14 @@ static void
|
||||
clobber_variable_part (dataflow_set *set, rtx loc, tree decl,
|
||||
HOST_WIDE_INT offset, rtx set_src)
|
||||
{
|
||||
- void **slot;
|
||||
+ variable var;
|
||||
|
||||
if (! decl || ! DECL_P (decl))
|
||||
return;
|
||||
|
||||
- slot = htab_find_slot_with_hash (set->vars, decl, VARIABLE_HASH_VAL (decl),
|
||||
- NO_INSERT);
|
||||
- if (slot)
|
||||
+ var = shared_hash_find (set->vars, decl);
|
||||
+ if (var)
|
||||
{
|
||||
- variable var = (variable) *slot;
|
||||
int pos = find_variable_location_part (var, offset, NULL);
|
||||
|
||||
if (pos >= 0)
|
||||
@@ -2627,13 +2793,9 @@ static void
|
||||
delete_variable_part (dataflow_set *set, rtx loc, tree decl,
|
||||
HOST_WIDE_INT offset)
|
||||
{
|
||||
- void **slot;
|
||||
-
|
||||
- slot = htab_find_slot_with_hash (set->vars, decl, VARIABLE_HASH_VAL (decl),
|
||||
- NO_INSERT);
|
||||
- if (slot)
|
||||
+ variable var = shared_hash_find (set->vars, decl);;
|
||||
+ if (var)
|
||||
{
|
||||
- variable var = (variable) *slot;
|
||||
int pos = find_variable_location_part (var, offset, NULL);
|
||||
|
||||
if (pos >= 0)
|
||||
@@ -2642,7 +2804,7 @@ delete_variable_part (dataflow_set *set,
|
||||
location_chain *nextp;
|
||||
bool changed;
|
||||
|
||||
- if (var->refcount > 1)
|
||||
+ if (var->refcount > 1 || shared_hash_shared (set->vars))
|
||||
{
|
||||
/* If the variable contains the location part we have to
|
||||
make a copy of the variable. */
|
||||
@@ -2705,7 +2867,7 @@ delete_variable_part (dataflow_set *set,
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
- variable_was_changed (var, set->vars);
|
||||
+ variable_was_changed (var, set);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2864,14 +3026,6 @@ emit_note_insn_var_location (void **varp
|
||||
|
||||
htab_clear_slot (changed_variables, varp);
|
||||
|
||||
- /* When there are no location parts the variable has been already
|
||||
- removed from hash table and a new empty variable was created.
|
||||
- Free the empty variable. */
|
||||
- if (var->n_var_parts == 0)
|
||||
- {
|
||||
- pool_free (var_pool, var);
|
||||
- }
|
||||
-
|
||||
/* Continue traversing the hash table. */
|
||||
return 1;
|
||||
}
|
||||
@@ -2910,7 +3064,7 @@ emit_notes_for_differences_1 (void **slo
|
||||
|
||||
empty_var = (variable) pool_alloc (var_pool);
|
||||
empty_var->decl = old_var->decl;
|
||||
- empty_var->refcount = 1;
|
||||
+ empty_var->refcount = 0;
|
||||
empty_var->n_var_parts = 0;
|
||||
variable_was_changed (empty_var, NULL);
|
||||
}
|
||||
@@ -2952,8 +3106,12 @@ static void
|
||||
emit_notes_for_differences (rtx insn, dataflow_set *old_set,
|
||||
dataflow_set *new_set)
|
||||
{
|
||||
- htab_traverse (old_set->vars, emit_notes_for_differences_1, new_set->vars);
|
||||
- htab_traverse (new_set->vars, emit_notes_for_differences_2, old_set->vars);
|
||||
+ htab_traverse (shared_hash_htab (old_set->vars),
|
||||
+ emit_notes_for_differences_1,
|
||||
+ shared_hash_htab (new_set->vars));
|
||||
+ htab_traverse (shared_hash_htab (new_set->vars),
|
||||
+ emit_notes_for_differences_2,
|
||||
+ shared_hash_htab (old_set->vars));
|
||||
emit_notes_for_changes (insn, EMIT_NOTE_BEFORE_INSN);
|
||||
}
|
||||
|
||||
@@ -2965,7 +3123,7 @@ emit_notes_in_bb (basic_block bb)
|
||||
int i;
|
||||
dataflow_set set;
|
||||
|
||||
- dataflow_set_init (&set, htab_elements (VTI (bb)->in.vars) + 3);
|
||||
+ dataflow_set_init (&set);
|
||||
dataflow_set_copy (&set, &VTI (bb)->in);
|
||||
|
||||
for (i = 0; i < VTI (bb)->n_mos; i++)
|
||||
@@ -3098,7 +3256,7 @@ vt_emit_notes (void)
|
||||
delete_variable_part). */
|
||||
emit_notes = true;
|
||||
|
||||
- dataflow_set_init (&empty, 7);
|
||||
+ dataflow_set_init (&empty);
|
||||
last_out = ∅
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
@@ -3343,14 +3501,6 @@ vt_initialize (void)
|
||||
}
|
||||
}
|
||||
|
||||
- /* Init the IN and OUT sets. */
|
||||
- FOR_ALL_BB (bb)
|
||||
- {
|
||||
- VTI (bb)->visited = false;
|
||||
- dataflow_set_init (&VTI (bb)->in, 7);
|
||||
- dataflow_set_init (&VTI (bb)->out, 7);
|
||||
- }
|
||||
-
|
||||
attrs_pool = create_alloc_pool ("attrs_def pool",
|
||||
sizeof (struct attrs_def), 1024);
|
||||
var_pool = create_alloc_pool ("variable_def pool",
|
||||
@@ -3358,8 +3508,24 @@ vt_initialize (void)
|
||||
loc_chain_pool = create_alloc_pool ("location_chain_def pool",
|
||||
sizeof (struct location_chain_def),
|
||||
1024);
|
||||
+ shared_hash_pool = create_alloc_pool ("shared_hash_def pool",
|
||||
+ sizeof (struct shared_hash_def), 256);
|
||||
+ empty_shared_hash = (shared_hash) pool_alloc (shared_hash_pool);
|
||||
+ empty_shared_hash->refcount = 1;
|
||||
+ empty_shared_hash->htab
|
||||
+ = htab_create (1, variable_htab_hash, variable_htab_eq,
|
||||
+ variable_htab_free);
|
||||
changed_variables = htab_create (10, variable_htab_hash, variable_htab_eq,
|
||||
- NULL);
|
||||
+ variable_htab_free);
|
||||
+
|
||||
+ /* Init the IN and OUT sets. */
|
||||
+ FOR_ALL_BB (bb)
|
||||
+ {
|
||||
+ VTI (bb)->visited = false;
|
||||
+ dataflow_set_init (&VTI (bb)->in);
|
||||
+ dataflow_set_init (&VTI (bb)->out);
|
||||
+ }
|
||||
+
|
||||
vt_add_function_parameters ();
|
||||
}
|
||||
|
||||
@@ -3381,10 +3547,12 @@ vt_finalize (void)
|
||||
dataflow_set_destroy (&VTI (bb)->out);
|
||||
}
|
||||
free_aux_for_blocks ();
|
||||
+ htab_delete (empty_shared_hash->htab);
|
||||
+ htab_delete (changed_variables);
|
||||
free_alloc_pool (attrs_pool);
|
||||
free_alloc_pool (var_pool);
|
||||
free_alloc_pool (loc_chain_pool);
|
||||
- htab_delete (changed_variables);
|
||||
+ free_alloc_pool (shared_hash_pool);
|
||||
}
|
||||
|
||||
/* The entry point to variable tracking pass. */
|
||||
--- libiberty/hashtab.c (revision 148758)
|
||||
+++ libiberty/hashtab.c (revision 148760)
|
||||
@@ -759,7 +759,8 @@ htab_traverse_noresize (htab_t htab, hta
|
||||
void
|
||||
htab_traverse (htab_t htab, htab_trav callback, PTR info)
|
||||
{
|
||||
- if (htab_elements (htab) * 8 < htab_size (htab))
|
||||
+ size_t size = htab_size (htab);
|
||||
+ if (htab_elements (htab) * 8 < size && size > 32)
|
||||
htab_expand (htab);
|
||||
|
||||
htab_traverse_noresize (htab, callback, info);
|
||||
491
gcc44-rh503816-2.patch
Normal file
491
gcc44-rh503816-2.patch
Normal file
@ -0,0 +1,491 @@
|
||||
2009-06-23 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* var-tracking.c (unshare_variable): Force initialized to
|
||||
be VAR_INIT_STATUS_INITIALIZED unless flag_var_tracking_uninit.
|
||||
(set_variable_part): Likewise.
|
||||
(struct variable_union_info): Remove pos_src field.
|
||||
(vui_vec, vui_allocated): New variables.
|
||||
(variable_union): Pass VAR_INIT_STATUS_UNKNOWN to unshare_variable
|
||||
unconditionally. Avoid XCVECNEW/free for every sorting, for dst_l
|
||||
== 1 use a simpler sorting algorithm. Compute pos field right
|
||||
away, don't fill in pos_src. For dst_l == 2 avoid qsort.
|
||||
Avoid quadratic comparison if !flag_var_tracking_uninit.
|
||||
(variable_canonicalize): Pass VAR_INIT_STATUS_UNKNOWN to
|
||||
unshare_variable unconditionally.
|
||||
(dataflow_set_different_2): Removed.
|
||||
(dataflow_set_different): Don't traverse second hash table.
|
||||
(compute_bb_dataflow): Pass VAR_INIT_STATUS_UNINITIALIZED
|
||||
unconditionally to var_reg_set or var_mem_set.
|
||||
(emit_notes_in_bb): Likewise.
|
||||
(delete_variable_part): Pass VAR_INIT_STATUS_UNKNOWN to
|
||||
unshare_variable.
|
||||
(emit_note_insn_var_location): Don't set initialized to
|
||||
VAR_INIT_STATUS_INITIALIZED early.
|
||||
(vt_finalize): Free vui_vec if needed, clear vui_vec and
|
||||
vui_allocated.
|
||||
|
||||
--- gcc/var-tracking.c (revision 148851)
|
||||
+++ gcc/var-tracking.c (revision 148852)
|
||||
@@ -347,7 +347,6 @@ static void dataflow_set_union (dataflow
|
||||
static bool variable_part_different_p (variable_part *, variable_part *);
|
||||
static bool variable_different_p (variable, variable, bool);
|
||||
static int dataflow_set_different_1 (void **, void *);
|
||||
-static int dataflow_set_different_2 (void **, void *);
|
||||
static bool dataflow_set_different (dataflow_set *, dataflow_set *);
|
||||
static void dataflow_set_destroy (dataflow_set *);
|
||||
|
||||
@@ -878,6 +877,9 @@ unshare_variable (dataflow_set *set, var
|
||||
var->refcount--;
|
||||
new_var->n_var_parts = var->n_var_parts;
|
||||
|
||||
+ if (! flag_var_tracking_uninit)
|
||||
+ initialized = VAR_INIT_STATUS_INITIALIZED;
|
||||
+
|
||||
for (i = 0; i < var->n_var_parts; i++)
|
||||
{
|
||||
location_chain node;
|
||||
@@ -1202,11 +1204,14 @@ struct variable_union_info
|
||||
/* The sum of positions in the input chains. */
|
||||
int pos;
|
||||
|
||||
- /* The position in the chains of SRC and DST dataflow sets. */
|
||||
- int pos_src;
|
||||
+ /* The position in the chain of DST dataflow set. */
|
||||
int pos_dst;
|
||||
};
|
||||
|
||||
+/* Buffer for location list sorting and its allocated size. */
|
||||
+static struct variable_union_info *vui_vec;
|
||||
+static int vui_allocated;
|
||||
+
|
||||
/* Compare function for qsort, order the structures by POS element. */
|
||||
|
||||
static int
|
||||
@@ -1263,14 +1268,9 @@ variable_union (void **slot, void *data)
|
||||
}
|
||||
if (k < src->n_var_parts)
|
||||
{
|
||||
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
||||
-
|
||||
- if (! flag_var_tracking_uninit)
|
||||
- status = VAR_INIT_STATUS_INITIALIZED;
|
||||
-
|
||||
if (dstp)
|
||||
*dstp = (void *) src;
|
||||
- unshare_variable (set, src, status);
|
||||
+ unshare_variable (set, src, VAR_INIT_STATUS_UNKNOWN);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1311,13 +1311,7 @@ variable_union (void **slot, void *data)
|
||||
|
||||
if ((dst->refcount > 1 || shared_hash_shared (set->vars))
|
||||
&& dst->n_var_parts != k)
|
||||
- {
|
||||
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
||||
-
|
||||
- if (! flag_var_tracking_uninit)
|
||||
- status = VAR_INIT_STATUS_INITIALIZED;
|
||||
- dst = unshare_variable (set, dst, status);
|
||||
- }
|
||||
+ dst = unshare_variable (set, dst, VAR_INIT_STATUS_UNKNOWN);
|
||||
|
||||
i = src->n_var_parts - 1;
|
||||
j = dst->n_var_parts - 1;
|
||||
@@ -1366,70 +1360,152 @@ variable_union (void **slot, void *data)
|
||||
dst_l = 0;
|
||||
for (node = dst->var_part[j].loc_chain; node; node = node->next)
|
||||
dst_l++;
|
||||
- vui = XCNEWVEC (struct variable_union_info, src_l + dst_l);
|
||||
|
||||
- /* Fill in the locations from DST. */
|
||||
- for (node = dst->var_part[j].loc_chain, jj = 0; node;
|
||||
- node = node->next, jj++)
|
||||
+ if (dst_l == 1)
|
||||
{
|
||||
- vui[jj].lc = node;
|
||||
- vui[jj].pos_dst = jj;
|
||||
+ /* The most common case, much simpler, no qsort is needed. */
|
||||
+ location_chain dstnode = dst->var_part[j].loc_chain;
|
||||
+ dst->var_part[k].loc_chain = dstnode;
|
||||
+ dst->var_part[k].offset = dst->var_part[j].offset;
|
||||
+ node2 = dstnode;
|
||||
+ for (node = src->var_part[i].loc_chain; node; node = node->next)
|
||||
+ if (!((REG_P (dstnode->loc)
|
||||
+ && REG_P (node->loc)
|
||||
+ && REGNO (dstnode->loc) == REGNO (node->loc))
|
||||
+ || rtx_equal_p (dstnode->loc, node->loc)))
|
||||
+ {
|
||||
+ location_chain new_node;
|
||||
|
||||
- /* Value larger than a sum of 2 valid positions. */
|
||||
- vui[jj].pos_src = src_l + dst_l;
|
||||
+ /* Copy the location from SRC. */
|
||||
+ new_node = (location_chain) pool_alloc (loc_chain_pool);
|
||||
+ new_node->loc = node->loc;
|
||||
+ new_node->init = node->init;
|
||||
+ if (!node->set_src || MEM_P (node->set_src))
|
||||
+ new_node->set_src = NULL;
|
||||
+ else
|
||||
+ new_node->set_src = node->set_src;
|
||||
+ node2->next = new_node;
|
||||
+ node2 = new_node;
|
||||
+ }
|
||||
+ node2->next = NULL;
|
||||
}
|
||||
-
|
||||
- /* Fill in the locations from SRC. */
|
||||
- n = dst_l;
|
||||
- for (node = src->var_part[i].loc_chain, ii = 0; node;
|
||||
- node = node->next, ii++)
|
||||
+ else
|
||||
{
|
||||
- /* Find location from NODE. */
|
||||
- for (jj = 0; jj < dst_l; jj++)
|
||||
+ if (src_l + dst_l > vui_allocated)
|
||||
{
|
||||
- if ((REG_P (vui[jj].lc->loc)
|
||||
- && REG_P (node->loc)
|
||||
- && REGNO (vui[jj].lc->loc) == REGNO (node->loc))
|
||||
- || rtx_equal_p (vui[jj].lc->loc, node->loc))
|
||||
- {
|
||||
- vui[jj].pos_src = ii;
|
||||
- break;
|
||||
- }
|
||||
+ vui_allocated = MAX (vui_allocated * 2, src_l + dst_l);
|
||||
+ vui_vec = XRESIZEVEC (struct variable_union_info, vui_vec,
|
||||
+ vui_allocated);
|
||||
}
|
||||
- if (jj >= dst_l) /* The location has not been found. */
|
||||
+ vui = vui_vec;
|
||||
+
|
||||
+ /* Fill in the locations from DST. */
|
||||
+ for (node = dst->var_part[j].loc_chain, jj = 0; node;
|
||||
+ node = node->next, jj++)
|
||||
{
|
||||
- location_chain new_node;
|
||||
+ vui[jj].lc = node;
|
||||
+ vui[jj].pos_dst = jj;
|
||||
|
||||
- /* Copy the location from SRC. */
|
||||
- new_node = (location_chain) pool_alloc (loc_chain_pool);
|
||||
- new_node->loc = node->loc;
|
||||
- new_node->init = node->init;
|
||||
- if (!node->set_src || MEM_P (node->set_src))
|
||||
- new_node->set_src = NULL;
|
||||
- else
|
||||
- new_node->set_src = node->set_src;
|
||||
- vui[n].lc = new_node;
|
||||
- vui[n].pos_src = ii;
|
||||
- vui[n].pos_dst = src_l + dst_l;
|
||||
- n++;
|
||||
+ /* Pos plus value larger than a sum of 2 valid positions. */
|
||||
+ vui[jj].pos = jj + src_l + dst_l;
|
||||
}
|
||||
- }
|
||||
|
||||
- for (ii = 0; ii < src_l + dst_l; ii++)
|
||||
- vui[ii].pos = vui[ii].pos_src + vui[ii].pos_dst;
|
||||
+ /* Fill in the locations from SRC. */
|
||||
+ n = dst_l;
|
||||
+ for (node = src->var_part[i].loc_chain, ii = 0; node;
|
||||
+ node = node->next, ii++)
|
||||
+ {
|
||||
+ /* Find location from NODE. */
|
||||
+ for (jj = 0; jj < dst_l; jj++)
|
||||
+ {
|
||||
+ if ((REG_P (vui[jj].lc->loc)
|
||||
+ && REG_P (node->loc)
|
||||
+ && REGNO (vui[jj].lc->loc) == REGNO (node->loc))
|
||||
+ || rtx_equal_p (vui[jj].lc->loc, node->loc))
|
||||
+ {
|
||||
+ vui[jj].pos = jj + ii;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (jj >= dst_l) /* The location has not been found. */
|
||||
+ {
|
||||
+ location_chain new_node;
|
||||
|
||||
- qsort (vui, n, sizeof (struct variable_union_info),
|
||||
- variable_union_info_cmp_pos);
|
||||
+ /* Copy the location from SRC. */
|
||||
+ new_node = (location_chain) pool_alloc (loc_chain_pool);
|
||||
+ new_node->loc = node->loc;
|
||||
+ new_node->init = node->init;
|
||||
+ if (!node->set_src || MEM_P (node->set_src))
|
||||
+ new_node->set_src = NULL;
|
||||
+ else
|
||||
+ new_node->set_src = node->set_src;
|
||||
+ vui[n].lc = new_node;
|
||||
+ vui[n].pos_dst = src_l + dst_l;
|
||||
+ vui[n].pos = ii + src_l + dst_l;
|
||||
+ n++;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- /* Reconnect the nodes in sorted order. */
|
||||
- for (ii = 1; ii < n; ii++)
|
||||
- vui[ii - 1].lc->next = vui[ii].lc;
|
||||
- vui[n - 1].lc->next = NULL;
|
||||
+ if (dst_l == 2)
|
||||
+ {
|
||||
+ /* Special case still very common case. For dst_l == 2
|
||||
+ all entries dst_l ... n-1 are sorted, with for i >= dst_l
|
||||
+ vui[i].pos == i + src_l + dst_l. */
|
||||
+ if (vui[0].pos > vui[1].pos)
|
||||
+ {
|
||||
+ /* Order should be 1, 0, 2... */
|
||||
+ dst->var_part[k].loc_chain = vui[1].lc;
|
||||
+ vui[1].lc->next = vui[0].lc;
|
||||
+ if (n >= 3)
|
||||
+ {
|
||||
+ vui[0].lc->next = vui[2].lc;
|
||||
+ vui[n - 1].lc->next = NULL;
|
||||
+ }
|
||||
+ else
|
||||
+ vui[0].lc->next = NULL;
|
||||
+ ii = 3;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ dst->var_part[k].loc_chain = vui[0].lc;
|
||||
+ if (n >= 3 && vui[2].pos < vui[1].pos)
|
||||
+ {
|
||||
+ /* Order should be 0, 2, 1, 3... */
|
||||
+ vui[0].lc->next = vui[2].lc;
|
||||
+ vui[2].lc->next = vui[1].lc;
|
||||
+ if (n >= 4)
|
||||
+ {
|
||||
+ vui[1].lc->next = vui[3].lc;
|
||||
+ vui[n - 1].lc->next = NULL;
|
||||
+ }
|
||||
+ else
|
||||
+ vui[1].lc->next = NULL;
|
||||
+ ii = 4;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Order should be 0, 1, 2... */
|
||||
+ ii = 1;
|
||||
+ vui[n - 1].lc->next = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ for (; ii < n; ii++)
|
||||
+ vui[ii - 1].lc->next = vui[ii].lc;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ qsort (vui, n, sizeof (struct variable_union_info),
|
||||
+ variable_union_info_cmp_pos);
|
||||
|
||||
- dst->var_part[k].loc_chain = vui[0].lc;
|
||||
- dst->var_part[k].offset = dst->var_part[j].offset;
|
||||
+ /* Reconnect the nodes in sorted order. */
|
||||
+ for (ii = 1; ii < n; ii++)
|
||||
+ vui[ii - 1].lc->next = vui[ii].lc;
|
||||
+ vui[n - 1].lc->next = NULL;
|
||||
+ dst->var_part[k].loc_chain = vui[0].lc;
|
||||
+ }
|
||||
|
||||
- free (vui);
|
||||
+ dst->var_part[k].offset = dst->var_part[j].offset;
|
||||
+ }
|
||||
i--;
|
||||
j--;
|
||||
}
|
||||
@@ -1477,17 +1553,18 @@ variable_union (void **slot, void *data)
|
||||
dst->var_part[k].cur_loc = NULL;
|
||||
}
|
||||
|
||||
- for (i = 0; i < src->n_var_parts && i < dst->n_var_parts; i++)
|
||||
- {
|
||||
- location_chain node, node2;
|
||||
- for (node = src->var_part[i].loc_chain; node; node = node->next)
|
||||
- for (node2 = dst->var_part[i].loc_chain; node2; node2 = node2->next)
|
||||
- if (rtx_equal_p (node->loc, node2->loc))
|
||||
- {
|
||||
- if (node->init > node2->init)
|
||||
- node2->init = node->init;
|
||||
- }
|
||||
- }
|
||||
+ if (flag_var_tracking_uninit)
|
||||
+ for (i = 0; i < src->n_var_parts && i < dst->n_var_parts; i++)
|
||||
+ {
|
||||
+ location_chain node, node2;
|
||||
+ for (node = src->var_part[i].loc_chain; node; node = node->next)
|
||||
+ for (node2 = dst->var_part[i].loc_chain; node2; node2 = node2->next)
|
||||
+ if (rtx_equal_p (node->loc, node2->loc))
|
||||
+ {
|
||||
+ if (node->init > node2->init)
|
||||
+ node2->init = node->init;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* Continue traversing the hash table. */
|
||||
return 1;
|
||||
@@ -1522,14 +1599,7 @@ variable_canonicalize (void **slot, void
|
||||
}
|
||||
}
|
||||
if (k < src->n_var_parts)
|
||||
- {
|
||||
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
||||
-
|
||||
- if (! flag_var_tracking_uninit)
|
||||
- status = VAR_INIT_STATUS_INITIALIZED;
|
||||
-
|
||||
- unshare_variable (set, src, status);
|
||||
- }
|
||||
+ unshare_variable (set, src, VAR_INIT_STATUS_UNKNOWN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1650,34 +1720,6 @@ dataflow_set_different_1 (void **slot, v
|
||||
return 1;
|
||||
}
|
||||
|
||||
-/* Compare variable *SLOT with the same variable in hash table DATA
|
||||
- and set DATAFLOW_SET_DIFFERENT_VALUE if they are different. */
|
||||
-
|
||||
-static int
|
||||
-dataflow_set_different_2 (void **slot, void *data)
|
||||
-{
|
||||
- htab_t htab = (htab_t) data;
|
||||
- variable var1, var2;
|
||||
-
|
||||
- var1 = *(variable *) slot;
|
||||
- var2 = (variable) htab_find_with_hash (htab, var1->decl,
|
||||
- VARIABLE_HASH_VAL (var1->decl));
|
||||
- if (!var2)
|
||||
- {
|
||||
- dataflow_set_different_value = true;
|
||||
-
|
||||
- /* Stop traversing the hash table. */
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- /* If both variables are defined they have been already checked for
|
||||
- equivalence. */
|
||||
- gcc_assert (!variable_different_p (var1, var2, false));
|
||||
-
|
||||
- /* Continue traversing the hash table. */
|
||||
- return 1;
|
||||
-}
|
||||
-
|
||||
/* Return true if dataflow sets OLD_SET and NEW_SET differ. */
|
||||
|
||||
static bool
|
||||
@@ -1694,14 +1736,9 @@ dataflow_set_different (dataflow_set *ol
|
||||
|
||||
htab_traverse (shared_hash_htab (old_set->vars), dataflow_set_different_1,
|
||||
shared_hash_htab (new_set->vars));
|
||||
- if (!dataflow_set_different_value)
|
||||
- {
|
||||
- /* We have compared the variables which are in both hash tables
|
||||
- so now only check whether there are some variables in NEW_SET->VARS
|
||||
- which are not in OLD_SET->VARS. */
|
||||
- htab_traverse (shared_hash_htab (new_set->vars), dataflow_set_different_2,
|
||||
- shared_hash_htab (old_set->vars));
|
||||
- }
|
||||
+ /* No need to traverse the second hashtab, if both have the same number
|
||||
+ of elements and the second one had all entries found in the first one,
|
||||
+ then it can't have any extra entries. */
|
||||
return dataflow_set_different_value;
|
||||
}
|
||||
|
||||
@@ -2215,15 +2252,11 @@ compute_bb_dataflow (basic_block bb)
|
||||
case MO_USE:
|
||||
{
|
||||
rtx loc = VTI (bb)->mos[i].u.loc;
|
||||
- enum var_init_status status = VAR_INIT_STATUS_UNINITIALIZED;
|
||||
-
|
||||
- if (! flag_var_tracking_uninit)
|
||||
- status = VAR_INIT_STATUS_INITIALIZED;
|
||||
|
||||
if (GET_CODE (loc) == REG)
|
||||
- var_reg_set (out, loc, status, NULL);
|
||||
+ var_reg_set (out, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
||||
else if (GET_CODE (loc) == MEM)
|
||||
- var_mem_set (out, loc, status, NULL);
|
||||
+ var_mem_set (out, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2262,10 +2295,12 @@ compute_bb_dataflow (basic_block bb)
|
||||
if (! flag_var_tracking_uninit)
|
||||
src_status = VAR_INIT_STATUS_INITIALIZED;
|
||||
else
|
||||
- src_status = find_src_status (in, set_src);
|
||||
+ {
|
||||
+ src_status = find_src_status (in, set_src);
|
||||
|
||||
- if (src_status == VAR_INIT_STATUS_UNKNOWN)
|
||||
- src_status = find_src_status (out, set_src);
|
||||
+ if (src_status == VAR_INIT_STATUS_UNKNOWN)
|
||||
+ src_status = find_src_status (out, set_src);
|
||||
+ }
|
||||
|
||||
set_src = find_src_set_src (in, set_src);
|
||||
|
||||
@@ -2609,6 +2644,9 @@ set_variable_part (dataflow_set *set, rt
|
||||
variable var;
|
||||
void **slot = shared_hash_find_slot (set->vars, decl);
|
||||
|
||||
+ if (! flag_var_tracking_uninit)
|
||||
+ initialized = VAR_INIT_STATUS_INITIALIZED;
|
||||
+
|
||||
if (!slot || !*slot)
|
||||
{
|
||||
if (!slot)
|
||||
@@ -2815,10 +2853,8 @@ delete_variable_part (dataflow_set *set,
|
||||
&& REGNO (node->loc) == REGNO (loc))
|
||||
|| rtx_equal_p (node->loc, loc))
|
||||
{
|
||||
- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN;
|
||||
- if (! flag_var_tracking_uninit)
|
||||
- status = VAR_INIT_STATUS_INITIALIZED;
|
||||
- var = unshare_variable (set, var, status);
|
||||
+ var = unshare_variable (set, var,
|
||||
+ VAR_INIT_STATUS_UNKNOWN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2893,9 +2929,6 @@ emit_note_insn_var_location (void **varp
|
||||
|
||||
gcc_assert (var->decl);
|
||||
|
||||
- if (! flag_var_tracking_uninit)
|
||||
- initialized = VAR_INIT_STATUS_INITIALIZED;
|
||||
-
|
||||
complete = true;
|
||||
last_limit = 0;
|
||||
n_var_parts = 0;
|
||||
@@ -3148,14 +3181,11 @@ emit_notes_in_bb (basic_block bb)
|
||||
case MO_USE:
|
||||
{
|
||||
rtx loc = VTI (bb)->mos[i].u.loc;
|
||||
-
|
||||
- enum var_init_status status = VAR_INIT_STATUS_UNINITIALIZED;
|
||||
- if (! flag_var_tracking_uninit)
|
||||
- status = VAR_INIT_STATUS_INITIALIZED;
|
||||
+
|
||||
if (GET_CODE (loc) == REG)
|
||||
- var_reg_set (&set, loc, status, NULL);
|
||||
+ var_reg_set (&set, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
||||
else
|
||||
- var_mem_set (&set, loc, status, NULL);
|
||||
+ var_mem_set (&set, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL);
|
||||
|
||||
emit_notes_for_changes (insn, EMIT_NOTE_AFTER_INSN);
|
||||
}
|
||||
@@ -3553,6 +3583,10 @@ vt_finalize (void)
|
||||
free_alloc_pool (var_pool);
|
||||
free_alloc_pool (loc_chain_pool);
|
||||
free_alloc_pool (shared_hash_pool);
|
||||
+ if (vui_vec)
|
||||
+ free (vui_vec);
|
||||
+ vui_vec = NULL;
|
||||
+ vui_allocated = 0;
|
||||
}
|
||||
|
||||
/* The entry point to variable tracking pass. */
|
||||
142
gcc44-unique-object.patch
Normal file
142
gcc44-unique-object.patch
Normal file
@ -0,0 +1,142 @@
|
||||
2009-07-22 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* config/elfos.h (ASM_DECLARE_OBJECT_NAME): Use gnu_unique_object
|
||||
type if available.
|
||||
* configure.ac: Test for it.
|
||||
* configure, config.in: Regenerate.
|
||||
|
||||
--- gcc/config/elfos.h.jj 2009-04-14 15:51:24.000000000 +0200
|
||||
+++ gcc/config/elfos.h 2009-07-23 09:25:46.000000000 +0200
|
||||
@@ -289,24 +289,37 @@ see the files COPYING3 and COPYING.RUNTI
|
||||
|
||||
/* Write the extra assembler code needed to declare an object properly. */
|
||||
|
||||
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
|
||||
- do \
|
||||
- { \
|
||||
- HOST_WIDE_INT size; \
|
||||
- \
|
||||
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
|
||||
- \
|
||||
- size_directive_output = 0; \
|
||||
- if (!flag_inhibit_size_directive \
|
||||
- && (DECL) && DECL_SIZE (DECL)) \
|
||||
- { \
|
||||
- size_directive_output = 1; \
|
||||
- size = int_size_in_bytes (TREE_TYPE (DECL)); \
|
||||
- ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
|
||||
- } \
|
||||
- \
|
||||
- ASM_OUTPUT_LABEL (FILE, NAME); \
|
||||
- } \
|
||||
+#ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
|
||||
+#define USE_GNU_UNIQUE_OBJECT 1
|
||||
+#else
|
||||
+#define USE_GNU_UNIQUE_OBJECT 0
|
||||
+#endif
|
||||
+
|
||||
+#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ HOST_WIDE_INT size; \
|
||||
+ \
|
||||
+ /* For template static data member instantiations or \
|
||||
+ inline fn local statics, use gnu_unique_object so that \
|
||||
+ they will be combined even under RTLD_LOCAL. */ \
|
||||
+ if (USE_GNU_UNIQUE_OBJECT \
|
||||
+ && !DECL_ARTIFICIAL (DECL) && DECL_ONE_ONLY (DECL)) \
|
||||
+ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "gnu_unique_object"); \
|
||||
+ else \
|
||||
+ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
|
||||
+ \
|
||||
+ size_directive_output = 0; \
|
||||
+ if (!flag_inhibit_size_directive \
|
||||
+ && (DECL) && DECL_SIZE (DECL)) \
|
||||
+ { \
|
||||
+ size_directive_output = 1; \
|
||||
+ size = int_size_in_bytes (TREE_TYPE (DECL)); \
|
||||
+ ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
|
||||
+ } \
|
||||
+ \
|
||||
+ ASM_OUTPUT_LABEL (FILE, NAME); \
|
||||
+ } \
|
||||
while (0)
|
||||
|
||||
/* Output the size directive for a decl in rest_of_decl_compilation
|
||||
--- gcc/configure.ac.jj 2009-03-28 09:53:59.000000000 +0100
|
||||
+++ gcc/configure.ac 2009-07-23 09:25:46.000000000 +0200
|
||||
@@ -3299,6 +3299,12 @@ gcc_GAS_CHECK_FEATURE([.lcomm with align
|
||||
[AC_DEFINE(HAVE_GAS_LCOMM_WITH_ALIGNMENT, 1,
|
||||
[Define if your assembler supports .lcomm with an alignment field.])])
|
||||
|
||||
+gcc_GAS_CHECK_FEATURE([gnu_unique_object], gcc_cv_as_gnu_unique_object,
|
||||
+ [elf,2,19,52],,
|
||||
+[.type foo, @gnu_unique_object],,
|
||||
+[AC_DEFINE(HAVE_GAS_GNU_UNIQUE_OBJECT, 1,
|
||||
+ [Define if your assembler supports @gnu_unique_object.])])
|
||||
+
|
||||
AC_CACHE_CHECK([assembler for tolerance to line number 0],
|
||||
[gcc_cv_as_line_zero],
|
||||
[gcc_cv_as_line_zero=no
|
||||
--- gcc/configure.jj 2009-03-28 09:53:37.000000000 +0100
|
||||
+++ gcc/configure 2009-07-23 09:26:52.000000000 +0200
|
||||
@@ -24288,6 +24288,44 @@ _ACEOF
|
||||
|
||||
fi
|
||||
|
||||
+echo "$as_me:$LINENO: checking assembler for gnu_unique_object" >&5
|
||||
+echo $ECHO_N "checking assembler for gnu_unique_object... $ECHO_C" >&6
|
||||
+if test "${gcc_cv_as_gnu_unique_object+set}" = set; then
|
||||
+ echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
+else
|
||||
+ gcc_cv_as_gnu_unique_object=no
|
||||
+ if test $in_tree_gas = yes; then
|
||||
+ if test $in_tree_gas_is_elf = yes \
|
||||
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 52`
|
||||
+ then gcc_cv_as_gnu_unique_object=yes
|
||||
+fi
|
||||
+ elif test x$gcc_cv_as != x; then
|
||||
+ echo '.type foo, @gnu_unique_object' > conftest.s
|
||||
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'
|
||||
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
+ (eval $ac_try) 2>&5
|
||||
+ ac_status=$?
|
||||
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
+ (exit $ac_status); }; }
|
||||
+ then
|
||||
+ gcc_cv_as_gnu_unique_object=yes
|
||||
+ else
|
||||
+ echo "configure: failed program was" >&5
|
||||
+ cat conftest.s >&5
|
||||
+ fi
|
||||
+ rm -f conftest.o conftest.s
|
||||
+ fi
|
||||
+fi
|
||||
+echo "$as_me:$LINENO: result: $gcc_cv_as_gnu_unique_object" >&5
|
||||
+echo "${ECHO_T}$gcc_cv_as_gnu_unique_object" >&6
|
||||
+if test $gcc_cv_as_gnu_unique_object = yes; then
|
||||
+
|
||||
+cat >>confdefs.h <<\_ACEOF
|
||||
+#define HAVE_GAS_GNU_UNIQUE_OBJECT 1
|
||||
+_ACEOF
|
||||
+
|
||||
+fi
|
||||
+
|
||||
echo "$as_me:$LINENO: checking assembler for tolerance to line number 0" >&5
|
||||
echo $ECHO_N "checking assembler for tolerance to line number 0... $ECHO_C" >&6
|
||||
if test "${gcc_cv_as_line_zero+set}" = set; then
|
||||
--- gcc/config.in.jj 2009-02-16 22:48:20.000000000 +0100
|
||||
+++ gcc/config.in 2009-07-23 09:26:56.000000000 +0200
|
||||
@@ -845,6 +845,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define if your assembler supports @gnu_unique_object. */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef HAVE_GAS_GNU_UNIQUE_OBJECT
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define if your assembler and linker support .hidden. */
|
||||
#undef HAVE_GAS_HIDDEN
|
||||
|
||||
46
gcc44-unwind-debug-hook.patch
Normal file
46
gcc44-unwind-debug-hook.patch
Normal file
@ -0,0 +1,46 @@
|
||||
2009-05-27 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* unwind-dw2.c (_Unwind_DebugHook): New function.
|
||||
(uw_install_context): Call _Unwind_DebugHook.
|
||||
|
||||
--- gcc/unwind-dw2.c (revision 147933)
|
||||
+++ gcc/unwind-dw2.c (revision 147934)
|
||||
@@ -1473,18 +1473,31 @@ uw_init_context_1 (struct _Unwind_Contex
|
||||
context->ra = __builtin_extract_return_addr (outer_ra);
|
||||
}
|
||||
|
||||
+static void _Unwind_DebugHook (void *, void *) __attribute__ ((__noinline__));
|
||||
+
|
||||
+/* This function is called during unwinding. It is intended as a hook
|
||||
+ for a debugger to intercept exceptions. CFA is the CFA of the
|
||||
+ target frame. HANDLER is the PC to which control will be
|
||||
+ transferred. */
|
||||
+static void
|
||||
+_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)),
|
||||
+ void *handler __attribute__ ((__unused__)))
|
||||
+{
|
||||
+ asm ("");
|
||||
+}
|
||||
|
||||
/* Install TARGET into CURRENT so that we can return to it. This is a
|
||||
macro because __builtin_eh_return must be invoked in the context of
|
||||
our caller. */
|
||||
|
||||
-#define uw_install_context(CURRENT, TARGET) \
|
||||
- do \
|
||||
- { \
|
||||
- long offset = uw_install_context_1 ((CURRENT), (TARGET)); \
|
||||
- void *handler = __builtin_frob_return_addr ((TARGET)->ra); \
|
||||
- __builtin_eh_return (offset, handler); \
|
||||
- } \
|
||||
+#define uw_install_context(CURRENT, TARGET) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ long offset = uw_install_context_1 ((CURRENT), (TARGET)); \
|
||||
+ void *handler = __builtin_frob_return_addr ((TARGET)->ra); \
|
||||
+ _Unwind_DebugHook ((TARGET)->cfa, handler); \
|
||||
+ __builtin_eh_return (offset, handler); \
|
||||
+ } \
|
||||
while (0)
|
||||
|
||||
static long
|
||||
@ -1,14 +1,14 @@
|
||||
%define __os_install_post /usr/lib/rpm/brp-compress %{nil}
|
||||
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
|
||||
|
||||
%define DATE 20090319
|
||||
%define SVNREV 144967
|
||||
%global DATE 20090818
|
||||
%global SVNREV 150873
|
||||
|
||||
Name: mingw32-gcc
|
||||
Version: 4.4.0
|
||||
Release: 0.8%{?dist}
|
||||
Version: 4.4.1
|
||||
Release: 1%{?dist}
|
||||
Summary: MinGW Windows cross-compiler (GCC) for C
|
||||
|
||||
License: GPLv3+ and GPLv2+ with exceptions
|
||||
License: GPLv3+, GPLv3+ with exceptions and GPLv2+ with exceptions
|
||||
Group: Development/Languages
|
||||
|
||||
# We use the same source as Fedora's native gcc.
|
||||
@ -25,8 +25,6 @@ Patch2: gcc44-c++-builtin-redecl.patch
|
||||
Patch3: gcc44-ia64-libunwind.patch
|
||||
Patch4: gcc44-java-nomulti.patch
|
||||
Patch5: gcc44-ppc32-retaddr.patch
|
||||
Patch7: gcc44-pr27898.patch
|
||||
Patch8: gcc44-pr32139.patch
|
||||
Patch9: gcc44-pr33763.patch
|
||||
Patch10: gcc44-rh330771.patch
|
||||
Patch11: gcc44-rh341221.patch
|
||||
@ -37,13 +35,15 @@ Patch16: gcc44-libgomp-omp_h-multilib.patch
|
||||
Patch20: gcc44-libtool-no-rpath.patch
|
||||
Patch21: gcc44-cloog-dl.patch
|
||||
Patch22: gcc44-raw-string.patch
|
||||
Patch24: gcc44-atom.patch
|
||||
Patch25: gcc44-pr39226.patch
|
||||
Patch26: gcc44-power7.patch
|
||||
Patch27: gcc44-power7-2.patch
|
||||
Patch24: gcc44-unwind-debug-hook.patch
|
||||
Patch25: gcc44-power7.patch
|
||||
Patch26: gcc44-power7-2.patch
|
||||
Patch27: gcc44-power7-3.patch
|
||||
Patch28: gcc44-pr38757.patch
|
||||
Patch29: gcc44-pr37959.patch
|
||||
Patch30: gcc44-memmove-opt.patch
|
||||
#Patch29: gcc44-libstdc++-docs.patch
|
||||
Patch30: gcc44-rh503816-1.patch
|
||||
Patch31: gcc44-rh503816-2.patch
|
||||
Patch32: gcc44-unique-object.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
@ -128,8 +128,6 @@ MinGW Windows cross-compiler for FORTRAN.
|
||||
%patch3 -p0 -b .ia64-libunwind~
|
||||
%patch4 -p0 -b .java-nomulti~
|
||||
%patch5 -p0 -b .ppc32-retaddr~
|
||||
%patch7 -p0 -b .pr27898~
|
||||
%patch8 -p0 -b .pr32139~
|
||||
%patch9 -p0 -b .pr33763~
|
||||
%patch10 -p0 -b .rh330771~
|
||||
%patch11 -p0 -b .rh341221~
|
||||
@ -140,13 +138,17 @@ MinGW Windows cross-compiler for FORTRAN.
|
||||
%patch20 -p0 -b .libtool-no-rpath~
|
||||
%patch21 -p0 -b .cloog-dl~
|
||||
%patch22 -p0 -b .raw-string~
|
||||
%patch24 -p0 -b .atom~
|
||||
%patch25 -p0 -b .pr39226~
|
||||
%patch26 -p0 -b .power7~
|
||||
%patch27 -p0 -b .power7-2~
|
||||
%patch24 -p0 -b .unwind-debug-hook~
|
||||
%patch25 -p0 -b .power7~
|
||||
%patch26 -p0 -b .power7-2~
|
||||
%patch27 -p0 -b .power7-3~
|
||||
%patch28 -p0 -b .pr38757~
|
||||
%patch29 -p0 -b .pr37959~
|
||||
%patch30 -p0 -b .memmove-opt~
|
||||
%patch30 -p0 -b .rh503816-1~
|
||||
%patch31 -p0 -b .rh503816-2~
|
||||
%patch32 -p0 -b .unique-object~
|
||||
|
||||
sed -i -e 's/4\.4\.2/%{version}/' gcc/BASE-VER
|
||||
echo 'Fedora MinGW %{version}-%{release}' > gcc/DEV-PHASE
|
||||
|
||||
|
||||
%build
|
||||
@ -216,7 +218,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/i686-pc-mingw32-gcc
|
||||
%{_bindir}/i686-pc-mingw32-gcc-%{version}
|
||||
%{_bindir}/i686-pc-mingw32-gccbug
|
||||
@ -253,7 +255,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files -n mingw32-cpp
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
/lib/i686-pc-mingw32-cpp
|
||||
%{_bindir}/i686-pc-mingw32-cpp
|
||||
%{_mandir}/man1/i686-pc-mingw32-cpp.1*
|
||||
@ -263,7 +265,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files c++
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/i686-pc-mingw32-g++
|
||||
%{_bindir}/i686-pc-mingw32-c++
|
||||
%{_mandir}/man1/i686-pc-mingw32-g++.1*
|
||||
@ -275,19 +277,19 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files objc
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/gcc/i686-pc-mingw32/%{version}/include/objc/
|
||||
%{_libdir}/gcc/i686-pc-mingw32/%{version}/libobjc.a
|
||||
%{_libexecdir}/gcc/i686-pc-mingw32/%{version}/cc1obj
|
||||
|
||||
|
||||
%files objc++
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
%{_libexecdir}/gcc/i686-pc-mingw32/%{version}/cc1objplus
|
||||
|
||||
|
||||
%files gfortran
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/i686-pc-mingw32-gfortran
|
||||
%{_mandir}/man1/i686-pc-mingw32-gfortran.1*
|
||||
%{_libdir}/gcc/i686-pc-mingw32/%{version}/libgfortran.a
|
||||
@ -296,6 +298,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Aug 23 2009 Kalev Lember <kalev@smartlink.ee> - 4.4.1-1
|
||||
- Update to gcc 4.4.1 20090818 svn 150873.
|
||||
- Patches taken from native Fedora gcc-4.4.1-6.
|
||||
- Replaced %%define with %%global and updated %%defattr.
|
||||
- Changed license to match native Fedora gcc package.
|
||||
|
||||
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.0-0.8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user