rpms/gcc/devel gcc43-pr29484.patch, NONE, 1.1 gcc43-pr34281.patch, NONE, 1.1 gcc43-pr34448.patch, NONE, 1.1 gcc43-pr34535.patch, NONE, 1.1 .cvsignore, 1.216, 1.217 gcc43.spec, 1.3, 1.4 sources, 1.218, 1.219 gcc43-ada-profiledbootstrap.patch, 1.1, NONE gcc43-libjava-gcjpath.patch, 1.1, NONE gcc43-libjava-test.patch, 1.1, NONE gcc43-pr29978.patch, 1.1, NONE gcc43-pr32636.patch, 1.1, NONE gcc43-pr34003.patch, 1.1, NONE gcc43-pr34427.patch, 1.2, NONE
Jakub Jelinek (jakub)
fedora-extras-commits at redhat.com
Thu Dec 20 16:34:46 UTC 2007
Author: jakub
Update of /cvs/pkgs/rpms/gcc/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20014
Modified Files:
.cvsignore gcc43.spec sources
Added Files:
gcc43-pr29484.patch gcc43-pr34281.patch gcc43-pr34448.patch
gcc43-pr34535.patch
Removed Files:
gcc43-ada-profiledbootstrap.patch gcc43-libjava-gcjpath.patch
gcc43-libjava-test.patch gcc43-pr29978.patch
gcc43-pr32636.patch gcc43-pr34003.patch gcc43-pr34427.patch
Log Message:
4.3.0-0.4
gcc43-pr29484.patch:
--- NEW FILE gcc43-pr29484.patch ---
2007-12-20 Jakub Jelinek <jakub at redhat.com>
PR tree-optimization/29484
* tree-inline.c (inline_forbidden_p_2): New function.
(inline_forbidden_p): Disallow inlining if some static var
has an address of a local LABEL_DECL in its initializer.
* gcc.c-torture/execute/20071220-1.c: New test.
* gcc.c-torture/execute/20071220-2.c: New test.
--- gcc/tree-inline.c.jj 2007-12-04 16:39:22.000000000 +0100
+++ gcc/tree-inline.c 2007-12-20 13:46:18.000000000 +0100
@@ -1951,6 +1951,27 @@ inline_forbidden_p_1 (tree *nodep, int *
return NULL_TREE;
}
+static tree
+inline_forbidden_p_2 (tree *nodep, int *walk_subtrees,
+ void *fnp)
+{
+ tree node = *nodep;
+ tree fn = (tree) fnp;
+
+ if (TREE_CODE (node) == LABEL_DECL && DECL_CONTEXT (node) == fn)
+ {
+ inline_forbidden_reason
+ = G_("function %q+F can never be inlined "
+ "because it saves address of local label in a static variable");
+ return node;
+ }
+
+ if (TYPE_P (node))
+ *walk_subtrees = 0;
+
+ return NULL_TREE;
+}
+
/* Return subexpression representing possible alloca call, if any. */
static tree
inline_forbidden_p (tree fndecl)
@@ -1959,16 +1980,31 @@ inline_forbidden_p (tree fndecl)
block_stmt_iterator bsi;
basic_block bb;
tree ret = NULL_TREE;
+ struct function *fun = DECL_STRUCT_FUNCTION (fndecl);
+ tree step;
- FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (fndecl))
+ FOR_EACH_BB_FN (bb, fun)
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
ret = walk_tree_without_duplicates (bsi_stmt_ptr (bsi),
- inline_forbidden_p_1, fndecl);
+ inline_forbidden_p_1, fndecl);
if (ret)
goto egress;
}
+ for (step = fun->unexpanded_var_list; step; step = TREE_CHAIN (step))
+ {
+ tree decl = TREE_VALUE (step);
+ if (TREE_CODE (decl) == VAR_DECL
+ && TREE_STATIC (decl)
+ && !DECL_EXTERNAL (decl)
+ && DECL_INITIAL (decl))
+ ret = walk_tree_without_duplicates (&DECL_INITIAL (decl),
+ inline_forbidden_p_2, fndecl);
+ if (ret)
+ goto egress;
+ }
+
egress:
input_location = saved_loc;
return ret;
--- gcc/testsuite/gcc.c-torture/execute/20071220-1.c.jj 2007-12-20 14:29:04.000000000 +0100
+++ gcc/testsuite/gcc.c-torture/execute/20071220-1.c 2007-12-20 14:28:12.000000000 +0100
@@ -0,0 +1,40 @@
+/* PR tree-optimization/29484 */
+
+extern void abort (void);
+
+void *__attribute__((noinline))
+baz (void **lab)
+{
+ asm volatile ("" : "+r" (lab));
+ return *lab;
+}
+
+static inline
+int bar (void)
+{
+ static void *b[] = { &&addr };
+ void *p = baz (b);
+ goto *p;
+addr:
+ return 17;
+}
+
+int __attribute__((noinline))
+f1 (void)
+{
+ return bar ();
+}
+
+int __attribute__((noinline))
+f2 (void)
+{
+ return bar ();
+}
+
+int
+main (void)
+{
+ if (f1 () != 17 || f1 () != 17 || f2 () != 17 || f2 () != 17)
+ abort ();
+ return 0;
+}
--- gcc/testsuite/gcc.c-torture/execute/20071220-2.c.jj 2007-12-20 14:29:13.000000000 +0100
+++ gcc/testsuite/gcc.c-torture/execute/20071220-2.c 2007-12-20 14:28:30.000000000 +0100
@@ -0,0 +1,39 @@
+/* PR tree-optimization/29484 */
+
+extern void abort (void);
+
+void *__attribute__((noinline))
+baz (void **lab)
+{
+ asm volatile ("" : "+r" (lab));
+ return *lab;
+}
+
+static inline
+int bar (void)
+{
+ static void *b[] = { &&addr };
+ baz (b);
+addr:
+ return 17;
+}
+
+int __attribute__((noinline))
+f1 (void)
+{
+ return bar ();
+}
+
+int __attribute__((noinline))
+f2 (void)
+{
+ return bar ();
+}
+
+int
+main (void)
+{
+ if (f1 () != 17 || f1 () != 17 || f2 () != 17 || f2 () != 17)
+ abort ();
+ return 0;
+}
gcc43-pr34281.patch:
--- NEW FILE gcc43-pr34281.patch ---
2007-12-13 Jakub Jelinek <jakub at redhat.com>
PR target/34281
* config/arm/arm.c (arm_setup_incoming_varargs): If last named
argument needs double word alignment and cum->nregs is odd, account
for the inserted padding.
* gcc.c-torture/execute/20071213-1.c: New test.
--- gcc/config/arm/arm.c.jj 2007-12-11 00:23:29.000000000 +0100
+++ gcc/config/arm/arm.c 2007-12-13 15:26:01.000000000 +0100
@@ -17765,14 +17765,20 @@ arm_output_load_gr (rtx *operands)
static void
arm_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
- enum machine_mode mode ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED,
+ enum machine_mode mode,
+ tree type,
int *pretend_size,
int second_time ATTRIBUTE_UNUSED)
{
+ int nregs = cum->nregs;
+ if (nregs & 1
+ && ARM_DOUBLEWORD_ALIGN
+ && arm_needs_doubleword_align (mode, type))
+ nregs++;
+
cfun->machine->uses_anonymous_args = 1;
- if (cum->nregs < NUM_ARG_REGS)
- *pretend_size = (NUM_ARG_REGS - cum->nregs) * UNITS_PER_WORD;
+ if (nregs < NUM_ARG_REGS)
+ *pretend_size = (NUM_ARG_REGS - nregs) * UNITS_PER_WORD;
}
/* Return nonzero if the CONSUMER instruction (a store) does not need
--- gcc/testsuite/gcc.c-torture/execute/20071213-1.c.jj 2007-12-13 16:47:49.000000000 +0100
+++ gcc/testsuite/gcc.c-torture/execute/20071213-1.c 2007-12-13 16:47:12.000000000 +0100
@@ -0,0 +1,53 @@
+/* PR target/34281 */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+void
+h (int x, va_list ap)
+{
+ switch (x)
+ {
+ case 1:
+ if (va_arg (ap, int) != 3 || va_arg (ap, int) != 4)
+ abort ();
+ return;
+ case 5:
+ if (va_arg (ap, int) != 9 || va_arg (ap, int) != 10)
+ abort ();
+ return;
+ default:
+ abort ();
+ }
+}
+
+void
+f1 (int i, long long int j, ...)
+{
+ va_list ap;
+ va_start (ap, j);
+ h (i, ap);
+ if (i != 1 || j != 2)
+ abort ();
+ va_end (ap);
+}
+
+void
+f2 (int i, int j, int k, long long int l, ...)
+{
+ va_list ap;
+ va_start (ap, l);
+ h (i, ap);
+ if (i != 5 || j != 6 || k != 7 || l != 8)
+ abort ();
+ va_end (ap);
+}
+
+int
+main ()
+{
+ f1 (1, 2, 3, 4);
+ f2 (5, 6, 7, 8, 9, 10);
+ return 0;
+}
gcc43-pr34448.patch:
--- NEW FILE gcc43-pr34448.patch ---
2007-12-17 Aldy Hernandez <aldyh at redhat.com>
PR tree-optimization/34448
PR tree-optimization/34465
* gimplify.c (gimplify_init_constructor): Add new parameter
notify_temp_creation. Use it.
(gimplify_modify_expr_rhs): Take volatiles into account when
optimizing constructors.
Do not optimize constructors if gimplify_init_constructor will dump to
memory.
* gcc.dg/tree-ssa/pr32901.c: Tests const volatiles.
* gcc.c-torture/compile/pr34448.c: New.
--- gcc/gimplify.c (revision 130934)
+++ gcc/gimplify.c (local)
@@ -3119,11 +3119,18 @@ gimplify_init_ctor_eval (tree object, VE
Note that we still need to clear any elements that don't have explicit
initializers, so if not all elements are initialized we keep the
- original MODIFY_EXPR, we just remove all of the constructor elements. */
+ original MODIFY_EXPR, we just remove all of the constructor elements.
+
+ If NOTIFY_TEMP_CREATION is true, do not gimplify, just return
+ GS_ERROR if we would have to create a temporary when gimplifying
+ this constructor. Otherwise, return GS_OK.
+
+ If NOTIFY_TEMP_CREATION is false, just do the gimplification. */
static enum gimplify_status
gimplify_init_constructor (tree *expr_p, tree *pre_p,
- tree *post_p, bool want_value)
+ tree *post_p, bool want_value,
+ bool notify_temp_creation)
{
tree object;
tree ctor = GENERIC_TREE_OPERAND (*expr_p, 1);
@@ -3134,10 +3141,13 @@ gimplify_init_constructor (tree *expr_p,
if (TREE_CODE (ctor) != CONSTRUCTOR)
return GS_UNHANDLED;
- ret = gimplify_expr (&GENERIC_TREE_OPERAND (*expr_p, 0), pre_p, post_p,
- is_gimple_lvalue, fb_lvalue);
- if (ret == GS_ERROR)
- return ret;
+ if (!notify_temp_creation)
+ {
+ ret = gimplify_expr (&GENERIC_TREE_OPERAND (*expr_p, 0), pre_p, post_p,
+ is_gimple_lvalue, fb_lvalue);
+ if (ret == GS_ERROR)
+ return ret;
+ }
object = GENERIC_TREE_OPERAND (*expr_p, 0);
elts = CONSTRUCTOR_ELTS (ctor);
@@ -3159,7 +3169,11 @@ gimplify_init_constructor (tree *expr_p,
individual elements. The exception is that a CONSTRUCTOR node
with no elements indicates zero-initialization of the whole. */
if (VEC_empty (constructor_elt, elts))
- break;
+ {
+ if (notify_temp_creation)
+ return GS_OK;
+ break;
+ }
/* Fetch information about the constructor to direct later processing.
We might want to make static versions of it in various cases, and
@@ -3175,6 +3189,8 @@ gimplify_init_constructor (tree *expr_p,
&& TREE_READONLY (object)
&& TREE_CODE (object) == VAR_DECL)
{
+ if (notify_temp_creation)
+ return GS_ERROR;
DECL_INITIAL (object) = ctor;
TREE_STATIC (object) = 1;
if (!DECL_NAME (object))
@@ -3251,7 +3267,12 @@ gimplify_init_constructor (tree *expr_p,
if (size > 0 && !can_move_by_pieces (size, align))
{
- tree new = create_tmp_var_raw (type, "C");
+ tree new;
+
+ if (notify_temp_creation)
+ return GS_ERROR;
+
+ new = create_tmp_var_raw (type, "C");
gimple_add_tmp_var (new);
TREE_STATIC (new) = 1;
@@ -3273,6 +3294,9 @@ gimplify_init_constructor (tree *expr_p,
}
}
+ if (notify_temp_creation)
+ return GS_OK;
+
/* If there are nonzero elements, pre-evaluate to capture elements
overlapping with the lhs into temporaries. We must do this before
clearing to fetch the values before they are zeroed-out. */
@@ -3312,6 +3336,9 @@ gimplify_init_constructor (tree *expr_p,
{
tree r, i;
+ if (notify_temp_creation)
+ return GS_OK;
+
/* Extract the real and imaginary parts out of the ctor. */
gcc_assert (VEC_length (constructor_elt, elts) == 2);
r = VEC_index (constructor_elt, elts, 0)->value;
@@ -3348,6 +3375,9 @@ gimplify_init_constructor (tree *expr_p,
unsigned HOST_WIDE_INT ix;
constructor_elt *ce;
+ if (notify_temp_creation)
+ return GS_OK;
+
/* Go ahead and simplify constant constructors to VECTOR_CST. */
if (TREE_CONSTANT (ctor))
{
@@ -3488,10 +3518,28 @@ gimplify_modify_expr_rhs (tree *expr_p,
constructor expression to the RHS of the MODIFY_EXPR. */
if (DECL_INITIAL (*from_p)
&& TYPE_READONLY (TREE_TYPE (*from_p))
+ && !TREE_THIS_VOLATILE (*from_p)
&& TREE_CODE (DECL_INITIAL (*from_p)) == CONSTRUCTOR)
{
- *from_p = DECL_INITIAL (*from_p);
- ret = GS_OK;
+ tree old_from = *from_p;
+
+ /* Move the constructor into the RHS. */
+ *from_p = DECL_INITIAL (*from_p);
+
+ /* Let's see if gimplify_init_constructor will need to put
+ it in memory. If so, revert the change. */
+ ret = gimplify_init_constructor (expr_p, NULL, NULL, false, true);
+ if (ret == GS_ERROR)
+ {
+ *from_p = old_from;
+ /* Fall through. */
+ }
+ else
+ {
+ *from_p = unshare_expr (*from_p);
+ ret = GS_OK;
+ break;
+ }
}
ret = GS_UNHANDLED;
break;
@@ -3551,7 +3599,8 @@ gimplify_modify_expr_rhs (tree *expr_p,
case CONSTRUCTOR:
/* If we're initializing from a CONSTRUCTOR, break this into
individual MODIFY_EXPRs. */
- return gimplify_init_constructor (expr_p, pre_p, post_p, want_value);
+ return gimplify_init_constructor (expr_p, pre_p, post_p, want_value,
+ false);
case COND_EXPR:
/* If we're assigning to a non-register type, push the assignment
--- gcc/testsuite/gcc.c-torture/compile/pr34448.c (revision 130934)
+++ gcc/testsuite/gcc.c-torture/compile/pr34448.c (local)
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+typedef struct chunk_t chunk_t;
+struct chunk_t
+{
+ unsigned char *ptr;
+ long unsigned int len;
+};
+extern chunk_t asn1_wrap (chunk_t c, ...);
+typedef struct linked_list_t linked_list_t;
+chunk_t ietfAttr_list_encode (linked_list_t * list);
+extern linked_list_t *groups;
+static unsigned char ASN1_group_oid_str[] = {
+ 0x06
+};
+static const chunk_t ASN1_group_oid = {
+ ASN1_group_oid_str, sizeof (ASN1_group_oid_str)
+};
+static chunk_t
+build_attribute_type (const chunk_t type, chunk_t content)
+{
+ return type;
+}
+static chunk_t
+build_attributes (void)
+{
+ return asn1_wrap (build_attribute_type (ASN1_group_oid,
+ ietfAttr_list_encode (groups)));
+}
+void build_attr_cert (void)
+{
+ asn1_wrap (build_attributes ());
+}
--- gcc/testsuite/gcc.dg/tree-ssa/pr32901.c (revision 130934)
+++ gcc/testsuite/gcc.dg/tree-ssa/pr32901.c (local)
@@ -7,7 +7,7 @@ struct foo {
unsigned : 4;
};
-extern struct foo thefoo;
+extern struct foo thefoo, theotherfoo;
void setup_foo(void)
{
@@ -15,10 +15,16 @@ void setup_foo(void)
.a1 = 1,
.a2 = 5,
};
+ volatile const struct foo volinit = {
+ .a1 = 0,
+ .a2 = 6
+ };
thefoo = init;
+ theotherfoo = volinit;
}
-/* { dg-final { scan-tree-dump-times "thefoo.0 = \{\}" 1 "gimple"} } */
-/* { dg-final { scan-tree-dump-times "thefoo.0.a1 = 1" 1 "gimple"} } */
-/* { dg-final { scan-tree-dump-times "thefoo.0.a2 = 5" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "thefoo.* = {}" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "thefoo.* = 1" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "thefoo.* = 5" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "theotherfoo = volinit" 1 "gimple"} } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
gcc43-pr34535.patch:
--- NEW FILE gcc43-pr34535.patch ---
2007-12-20 Jakub Jelinek <jakub at redhat.com>
PR debug/34535
* tree-mudflap.c (mf_make_builtin): Make decl artificial
and don't emit debug info for it.
PR debug/34535
* cp-lang.c (cp_classify_record): Check TYPE_LANG_SPECIFIC
is non-NULL before testing CLASSTYPE_DECLARED_CLASS.
--- gcc/cp/cp-lang.c.jj 2007-12-16 12:36:16.000000000 +0100
+++ gcc/cp/cp-lang.c 2007-12-20 10:58:19.000000000 +0100
@@ -159,7 +159,7 @@ cxx_dwarf_name (tree t, int verbosity)
static enum classify_record
cp_classify_record (tree type)
{
- if (CLASSTYPE_DECLARED_CLASS (type))
+ if (TYPE_LANG_SPECIFIC (type) && CLASSTYPE_DECLARED_CLASS (type))
return RECORD_IS_CLASS;
return RECORD_IS_STRUCT;
--- gcc/tree-mudflap.c.jj 2007-08-13 15:11:18.000000000 +0200
+++ gcc/tree-mudflap.c 2007-12-20 11:15:01.000000000 +0100
@@ -301,6 +301,10 @@ mf_make_builtin (enum tree_code category
TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = 1;
lang_hooks.decls.pushdecl (decl);
+ /* The decl was declared by the compiler. */
+ DECL_ARTIFICIAL (decl) = 1;
+ /* And we don't want debug info for it. */
+ DECL_IGNORED_P (decl) = 1;
return decl;
}
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/.cvsignore,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -r1.216 -r1.217
--- .cvsignore 14 Dec 2007 18:00:42 -0000 1.216
+++ .cvsignore 20 Dec 2007 16:34:11 -0000 1.217
@@ -1,2 +1,2 @@
-gcc-4.3.0-20071212.tar.bz2
+gcc-4.3.0-20071220.tar.bz2
fastjar-0.95.tar.gz
Index: gcc43.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc43.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gcc43.spec 14 Dec 2007 18:00:42 -0000 1.3
+++ gcc43.spec 20 Dec 2007 16:34:11 -0000 1.4
@@ -1,6 +1,6 @@
-%define DATE 20071212
+%define DATE 20071220
%define gcc_version 4.3.0
-%define gcc_release 0.3
+%define gcc_release 0.4
%define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64
%define include_gappletviewer 1
@@ -136,15 +136,12 @@
Patch7: gcc43-pr27898.patch
Patch8: gcc43-pr32139.patch
Patch9: gcc43-pr33763.patch
-Patch10: gcc43-pr32636.patch
+Patch10: gcc43-pr29484.patch
Patch11: gcc43-rh330771.patch
Patch12: gcc43-rh341221.patch
-Patch13: gcc43-libjava-test.patch
-Patch14: gcc43-pr34427.patch
-Patch15: gcc43-libjava-gcjpath.patch
-Patch16: gcc43-pr34003.patch
-Patch17: gcc43-ada-profiledbootstrap.patch
-Patch18: gcc43-pr29978.patch
+Patch13: gcc43-pr34281.patch
+Patch14: gcc43-pr34448.patch
+Patch15: gcc43-pr34535.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
# target triple.
@@ -437,15 +434,12 @@
%patch7 -p0 -b .pr27898~
%patch8 -p0 -b .pr32139~
%patch9 -p0 -b .pr33763~
-%patch10 -p0 -b .pr32636~
+%patch10 -p0 -b .pr29484~
%patch11 -p0 -b .rh330771~
%patch12 -p0 -b .rh341221~
-%patch13 -p0 -b .libjava-test~
-%patch14 -p0 -E -b .pr34427~
-%patch15 -p0 -b .libjava-gcjpath~
-%patch16 -p0 -b .pr34003~
-%patch17 -p0 -b .ada-profiledbootstrap~
-%patch18 -p0 -b .pr29978~
+%patch13 -p0 -b .pr34281~
+%patch14 -p0 -b .pr34448~
+%patch15 -p0 -b .pr34535~
tar xzf %{SOURCE4}
@@ -1653,6 +1647,9 @@
%doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog
+* Thu Dec 20 2007 Jakub Jelinek <jakub at redhat.com> 4.3.0-0.4
+- update from the trunk
+
* Fri Dec 14 2007 Jakub Jelinek <jakub at redhat.com> 4.3.0-0.3
- build fastjar, gjar is uncomparably worse
- fix profiledbootstrap and use it
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/sources,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -r1.218 -r1.219
--- sources 14 Dec 2007 18:00:42 -0000 1.218
+++ sources 20 Dec 2007 16:34:11 -0000 1.219
@@ -1,2 +1,2 @@
-65ac33620b3605f6c612b8591d7f7fa1 gcc-4.3.0-20071212.tar.bz2
+c29e437a88678a93a9750caf304b69bc gcc-4.3.0-20071220.tar.bz2
92a70f9e56223b653bce0f58f90cf950 fastjar-0.95.tar.gz
--- gcc43-ada-profiledbootstrap.patch DELETED ---
--- gcc43-libjava-gcjpath.patch DELETED ---
--- gcc43-libjava-test.patch DELETED ---
--- gcc43-pr29978.patch DELETED ---
--- gcc43-pr32636.patch DELETED ---
--- gcc43-pr34003.patch DELETED ---
--- gcc43-pr34427.patch DELETED ---
More information about the fedora-extras-commits
mailing list