This commit is contained in:
Jakub Jelinek 2008-04-16 08:15:27 +00:00
parent 08a0a12f84
commit ae41cd9081
9 changed files with 387 additions and 178 deletions

View File

@ -1,2 +1,2 @@
gcc-4.3.0-20080404.tar.bz2
gcc-4.3.0-20080416.tar.bz2
fastjar-0.95.tar.gz

View File

@ -1,56 +0,0 @@
2008-03-19 Jakub Jelinek <jakub@redhat.com>
PR c/35440
* c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR
for all types.
* gcc.dg/pr35440.c: New test.
--- gcc/c-pretty-print.c.jj 2008-02-11 14:48:12.000000000 +0100
+++ gcc/c-pretty-print.c 2008-03-19 14:50:09.000000000 +0100
@@ -1173,6 +1173,12 @@ pp_c_initializer_list (c_pretty_printer
tree type = TREE_TYPE (e);
const enum tree_code code = TREE_CODE (type);
+ if (TREE_CODE (e) == CONSTRUCTOR)
+ {
+ pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
+ return;
+ }
+
switch (code)
{
case RECORD_TYPE:
@@ -1207,16 +1213,12 @@ pp_c_initializer_list (c_pretty_printer
case VECTOR_TYPE:
if (TREE_CODE (e) == VECTOR_CST)
pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
- else if (TREE_CODE (e) == CONSTRUCTOR)
- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
else
break;
return;
case COMPLEX_TYPE:
- if (TREE_CODE (e) == CONSTRUCTOR)
- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
- else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
+ if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
{
const bool cst = TREE_CODE (e) == COMPLEX_CST;
pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0));
--- gcc/testsuite/gcc.dg/pr35440.c.jj 2008-03-19 15:57:13.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr35440.c 2008-03-19 15:47:35.000000000 +0100
@@ -0,0 +1,12 @@
+/* PR c/35440 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+struct A {};
+struct B { int i; char j[2]; };
+
+void foo (void)
+{
+ (struct A){}(); /* { dg-error "called object" } */
+ (struct B){ .i = 2, .j[1] = 1 }(); /* { dg-error "called object" } */
+}

65
gcc43-pr35662.patch Normal file
View File

@ -0,0 +1,65 @@
2008-04-15 Jakub Jelinek <jakub@redhat.com>
PR target/35662
* f95-lang.c (gfc_init_builtin_functions): Make sure
BUILT_IN_SINCOS{,F,L} types aren't varargs.
* gfortran.dg/pr35662.f90: New test.
--- gcc/fortran/f95-lang.c.jj 2008-02-29 09:11:54.000000000 +0100
+++ gcc/fortran/f95-lang.c 2008-04-15 13:17:50.000000000 +0200
@@ -1,5 +1,5 @@
/* gfortran backend interface
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Paul Brook.
@@ -853,21 +853,21 @@ gfc_init_builtin_functions (void)
ptype = build_pointer_type (float_type_node);
tmp = tree_cons (NULL_TREE, float_type_node,
tree_cons (NULL_TREE, ptype,
- build_tree_list (NULL_TREE, ptype)));
+ tree_cons (NULL_TREE, ptype, void_list_node)));
func_float_floatp_floatp =
build_function_type (void_type_node, tmp);
ptype = build_pointer_type (double_type_node);
tmp = tree_cons (NULL_TREE, double_type_node,
tree_cons (NULL_TREE, ptype,
- build_tree_list (NULL_TREE, ptype)));
+ tree_cons (NULL_TREE, ptype, void_list_node)));
func_double_doublep_doublep =
build_function_type (void_type_node, tmp);
ptype = build_pointer_type (long_double_type_node);
tmp = tree_cons (NULL_TREE, long_double_type_node,
tree_cons (NULL_TREE, ptype,
- build_tree_list (NULL_TREE, ptype)));
+ tree_cons (NULL_TREE, ptype, void_list_node)));
func_longdouble_longdoublep_longdoublep =
build_function_type (void_type_node, tmp);
--- gcc/testsuite/gfortran.dg/pr35662.f90.jj 2008-04-15 13:44:17.000000000 +0200
+++ gcc/testsuite/gfortran.dg/pr35662.f90 2008-04-15 13:44:09.000000000 +0200
@@ -0,0 +1,20 @@
+! PR target/35662
+! { dg-do run }
+! { dg-options "-O1" }
+
+subroutine f(x, y, z)
+ real, intent (in) :: x
+ real, intent (out) :: y, z
+ y = sin (x)
+ z = cos (x)
+end subroutine f
+
+program pr35662
+ real :: x, y, z
+ x = 3.1415926535897932384626433832795029
+ call f (x, y, z)
+ if (abs (y) > 1.0e-5 .or. abs (z + 1.0) > 1.0e-5) call abort
+ x = x / 2.0
+ call f (x, y, z)
+ if (abs (y - 1.0) > 1.0e-5 .or. abs (z) > 1.0e-5) call abort
+end program pr35662

48
gcc43-pr35739.patch Normal file
View File

@ -0,0 +1,48 @@
2008-04-15 Jakub Jelinek <jakub@redhat.com>
PR c/35739
* tree-nrv.c (tree_nrv): Don't optimize if result_type is GIMPLE
reg type.
* gcc.dg/dfp/pr35739.c: New test.
--- gcc/tree-nrv.c.jj 2008-04-04 15:12:00.000000000 +0200
+++ gcc/tree-nrv.c 2008-04-15 20:00:07.000000000 +0200
@@ -1,5 +1,5 @@
/* Language independent return value optimizations
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -115,6 +115,11 @@ tree_nrv (void)
if (!aggregate_value_p (result, current_function_decl))
return 0;
+ /* If a GIMPLE type is returned in memory, finalize_nrv_r might create
+ non-GIMPLE. */
+ if (is_gimple_reg_type (result_type))
+ return 0;
+
/* Look through each block for assignments to the RESULT_DECL. */
FOR_EACH_BB (bb)
{
--- gcc/testsuite/gcc.dg/dfp/pr35739.c.jj 2008-04-15 20:02:55.000000000 +0200
+++ gcc/testsuite/gcc.dg/dfp/pr35739.c 2008-04-15 20:18:15.000000000 +0200
@@ -0,0 +1,16 @@
+/* PR c/35739 */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O -fpreprocessed -fmudflap" } */
+
+_Decimal128
+foo (int n, ...)
+{
+ int i;
+ _Decimal128 j = 0;
+ __builtin_va_list ap;
+ __builtin_va_start (ap, n);
+ for (i = 0; i < n; i++)
+ j += __builtin_va_arg (ap, _Decimal128);
+ __builtin_va_end (ap);
+ return j;
+}

View File

@ -1,114 +0,0 @@
2008-04-03 Jakub Jelinek <jakub@redhat.com>
PR c/35751
* c-decl.c (finish_decl): If extern or static var has variable
size, set TREE_TYPE (decl) to error_mark_node.
* decl.c (layout_var_decl): If extern or static var has variable
size, set TREE_TYPE (decl) to error_mark_node.
* gcc.dg/gomp/pr35751.c: New test.
* g++.dg/gomp/pr35751.C: New test.
--- gcc/c-decl.c.jj 2008-04-03 09:41:42.000000000 +0200
+++ gcc/c-decl.c 2008-04-03 18:20:52.000000000 +0200
@@ -3481,7 +3481,10 @@ finish_decl (tree decl, tree init, tree
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
else
- error ("storage size of %q+D isn%'t constant", decl);
+ {
+ error ("storage size of %q+D isn%'t constant", decl);
+ TREE_TYPE (decl) = error_mark_node;
+ }
}
if (TREE_USED (type))
--- gcc/cp/decl.c.jj 2008-03-31 23:54:40.000000000 +0200
+++ gcc/cp/decl.c 2008-04-03 18:30:19.000000000 +0200
@@ -4442,7 +4442,10 @@ layout_var_decl (tree decl)
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
else
- error ("storage size of %qD isn't constant", decl);
+ {
+ error ("storage size of %qD isn't constant", decl);
+ TREE_TYPE (decl) = error_mark_node;
+ }
}
}
--- gcc/testsuite/gcc.dg/gomp/pr35751.c.jj 2008-04-03 18:26:12.000000000 +0200
+++ gcc/testsuite/gcc.dg/gomp/pr35751.c 2008-04-03 18:25:51.000000000 +0200
@@ -0,0 +1,34 @@
+/* PR c/35751 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (int i)
+{
+ extern int a[i]; /* { dg-error "must have no linkage|storage size of" } */
+ static int b[i]; /* { dg-error "storage size of" } */
+
+#pragma omp parallel
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel shared (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel private (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel firstprivate (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+}
--- gcc/testsuite/g++.dg/gomp/pr35751.C.jj 2008-04-03 18:32:13.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/pr35751.C 2008-04-03 18:32:32.000000000 +0200
@@ -0,0 +1,34 @@
+// PR c/35751
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+void
+foo (int i)
+{
+ extern int a[i]; // { dg-error "storage size of" }
+ static int b[i]; // { dg-error "storage size of" }
+
+#pragma omp parallel
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel shared (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel private (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel firstprivate (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+}

47
gcc43-pr35899.patch Normal file
View File

@ -0,0 +1,47 @@
2008-04-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/35899
* tree-inline.c (expand_call_inline): Use GIMPLE_STMT_OPERAND
rather than TREE_OPERAND.
* gcc.dg/pr35899.c: New test.
--- gcc/tree-inline.c.jj 2008-04-03 09:41:42.000000000 +0200
+++ gcc/tree-inline.c 2008-04-15 18:18:56.000000000 +0200
@@ -2868,15 +2868,15 @@ expand_call_inline (basic_block bb, tree
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
{
- tree name = TREE_OPERAND (stmt, 0);
- tree var = SSA_NAME_VAR (TREE_OPERAND (stmt, 0));
+ tree name = GIMPLE_STMT_OPERAND (stmt, 0);
+ tree var = SSA_NAME_VAR (GIMPLE_STMT_OPERAND (stmt, 0));
tree def = gimple_default_def (cfun, var);
/* If the variable is used undefined, make this name undefined via
move. */
if (def)
{
- TREE_OPERAND (stmt, 1) = def;
+ GIMPLE_STMT_OPERAND (stmt, 1) = def;
update_stmt (stmt);
}
/* Otherwise make this variable undefined. */
--- gcc/testsuite/gcc.dg/pr35899.c.jj 2008-04-15 18:45:24.000000000 +0200
+++ gcc/testsuite/gcc.dg/pr35899.c 2008-04-15 18:43:10.000000000 +0200
@@ -0,0 +1,15 @@
+/* PR tree-optimization/35899 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a = bar (); /* { dg-warning "previous implicit declaration" } */
+ return a;
+}
+
+void
+bar (void) /* { dg-warning "conflicting types for" } */
+{
+}

206
gcc43-pr35907.patch Normal file
View File

@ -0,0 +1,206 @@
2008-04-14 Alan Modra <amodra@bigpond.net.au>
PR target/35907
* config/rs6000/rs6000.c (rs6000_emit_epilogue): Restore Altivec
registers using saved backchain as base instead of sp. Restore
Altivec registers and VRSAVE before increasing sp if they are saved
below red zone.
* gcc.target/powerpc/pr35907.c: New test.
--- gcc/config/rs6000/rs6000.c.jj 2008-04-16 09:43:10.000000000 +0200
+++ gcc/config/rs6000/rs6000.c 2008-04-16 10:05:34.000000000 +0200
@@ -16380,11 +16380,23 @@ rs6000_emit_epilogue (int sibcall)
if (info->push_p)
sp_offset = info->total_size;
- /* Restore AltiVec registers if needed. */
- if (TARGET_ALTIVEC_ABI && info->altivec_size != 0)
+ /* Restore AltiVec registers if we must do so before adjusting the
+ stack. */
+ if (TARGET_ALTIVEC_ABI
+ && info->altivec_size != 0
+ && DEFAULT_ABI != ABI_V4
+ && info->altivec_save_offset < (TARGET_32BIT ? -220 : -288))
{
int i;
+ if (use_backchain_to_restore_sp)
+ {
+ frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+ emit_move_insn (frame_reg_rtx,
+ gen_rtx_MEM (Pmode, sp_reg_rtx));
+ sp_offset = 0;
+ }
+
for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
{
@@ -16404,19 +16416,54 @@ rs6000_emit_epilogue (int sibcall)
}
}
+ /* Restore VRSAVE if we must do so before adjusting the stack. */
+ if (TARGET_ALTIVEC
+ && TARGET_ALTIVEC_VRSAVE
+ && info->vrsave_mask != 0
+ && DEFAULT_ABI != ABI_V4
+ && info->vrsave_save_offset < (TARGET_32BIT ? -220 : -288))
+ {
+ rtx addr, mem, reg;
+
+ if (use_backchain_to_restore_sp
+ && frame_reg_rtx == sp_reg_rtx)
+ {
+ frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+ emit_move_insn (frame_reg_rtx,
+ gen_rtx_MEM (Pmode, sp_reg_rtx));
+ sp_offset = 0;
+ }
+
+ addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
+ GEN_INT (info->vrsave_save_offset + sp_offset));
+ mem = gen_frame_mem (SImode, addr);
+ reg = gen_rtx_REG (SImode, 12);
+ emit_move_insn (reg, mem);
+
+ emit_insn (generate_set_vrsave (reg, info, 1));
+ }
+
/* If we have a frame pointer, a call to alloca, or a large stack
frame, restore the old stack pointer using the backchain. Otherwise,
we know what size to update it with. */
if (use_backchain_to_restore_sp)
{
- /* Under V.4, don't reset the stack pointer until after we're done
- loading the saved registers. */
- if (DEFAULT_ABI == ABI_V4)
- frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+ if (frame_reg_rtx != sp_reg_rtx)
+ {
+ emit_move_insn (sp_reg_rtx, frame_reg_rtx);
+ frame_reg_rtx = sp_reg_rtx;
+ }
+ else
+ {
+ /* Under V.4, don't reset the stack pointer until after we're done
+ loading the saved registers. */
+ if (DEFAULT_ABI == ABI_V4)
+ frame_reg_rtx = gen_rtx_REG (Pmode, 11);
- emit_move_insn (frame_reg_rtx,
- gen_rtx_MEM (Pmode, sp_reg_rtx));
- sp_offset = 0;
+ emit_move_insn (frame_reg_rtx,
+ gen_rtx_MEM (Pmode, sp_reg_rtx));
+ sp_offset = 0;
+ }
}
else if (info->push_p
&& DEFAULT_ABI != ABI_V4
@@ -16430,9 +16477,39 @@ rs6000_emit_epilogue (int sibcall)
sp_offset = 0;
}
- /* Restore VRSAVE if needed. */
- if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE
- && info->vrsave_mask != 0)
+ /* Restore AltiVec registers if we have not done so already. */
+ if (TARGET_ALTIVEC_ABI
+ && info->altivec_size != 0
+ && (DEFAULT_ABI == ABI_V4
+ || info->altivec_save_offset >= (TARGET_32BIT ? -220 : -288)))
+ {
+ int i;
+
+ for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
+ if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
+ {
+ rtx addr, areg, mem;
+
+ areg = gen_rtx_REG (Pmode, 0);
+ emit_move_insn
+ (areg, GEN_INT (info->altivec_save_offset
+ + sp_offset
+ + 16 * (i - info->first_altivec_reg_save)));
+
+ /* AltiVec addressing mode is [reg+reg]. */
+ addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, areg);
+ mem = gen_frame_mem (V4SImode, addr);
+
+ emit_move_insn (gen_rtx_REG (V4SImode, i), mem);
+ }
+ }
+
+ /* Restore VRSAVE if we have not done so already. */
+ if (TARGET_ALTIVEC
+ && TARGET_ALTIVEC_VRSAVE
+ && info->vrsave_mask != 0
+ && (DEFAULT_ABI == ABI_V4
+ || info->vrsave_save_offset >= (TARGET_32BIT ? -220 : -288)))
{
rtx addr, mem, reg;
--- gcc/testsuite/gcc.target/powerpc/pr35907.c.jj 2008-04-16 10:04:23.000000000 +0200
+++ gcc/testsuite/gcc.target/powerpc/pr35907.c 2008-04-16 10:04:58.000000000 +0200
@@ -0,0 +1,60 @@
+/* PR target/35907 */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-O2 -maltivec" } */
+
+#include "altivec_check.h"
+
+#define vector __attribute__((vector_size (16)))
+union
+{
+ vector int k;
+ int c[16];
+} u, v, w;
+vector int m;
+
+void __attribute__((noinline))
+bar (void *i, vector int j)
+{
+ asm volatile ("" : : "r" (i), "r" (&j) : "memory");
+}
+
+int __attribute__((noinline))
+foo (int i, vector int j)
+{
+ char *p = __builtin_alloca (64 + i);
+ m += u.k;
+ v.k = m;
+ w.k = j;
+ if (__builtin_memcmp (&v.c, &w.c, 16) != 0)
+ __builtin_abort ();
+ j += u.k;
+ bar (p, j);
+ j += u.k;
+ bar (p, j);
+ return 0;
+}
+
+void
+main1 (void)
+{
+ vector int l;
+ int i;
+ for (i = 0; i < 4; i++)
+ u.c[i] = i;
+ l = u.k;
+ if (foo (64, l))
+ __builtin_abort ();
+ l += u.k;
+ if (foo (64, l))
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ altivec_check ();
+ main1 ();
+ exit (0);
+}
+

View File

@ -1,6 +1,6 @@
%define DATE 20080404
%define DATE 20080416
%define gcc_version 4.3.0
%define gcc_release 6
%define gcc_release 7
%define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64
%define include_gappletviewer 1
@ -141,10 +141,12 @@ Patch11: gcc43-rh341221.patch
Patch12: gcc43-cpp-pragma.patch
Patch13: gcc43-java-debug-iface-type.patch
Patch14: gcc43-libgomp-speedup.patch
Patch15: gcc43-pr35440.patch
Patch15: gcc43-pr35662.patch
Patch16: gcc43-i386-libgomp.patch
Patch17: gcc43-pr35751.patch
Patch17: gcc43-pr35739.patch
Patch18: gcc43-rh251682.patch
Patch19: gcc43-pr35899.patch
Patch20: gcc43-pr35907.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
# target triple.
@ -443,10 +445,12 @@ which are required to run programs compiled with the GNAT.
%patch12 -p0 -b .cpp-pragma~
%patch13 -p0 -b .java-debug-iface-type~
%patch14 -p0 -b .libgomp-speedup~
%patch15 -p0 -b .pr35440~
%patch15 -p0 -b .pr35662~
%patch16 -p0 -b .i386-libgomp~
%patch17 -p0 -b .pr35751~
%patch17 -p0 -b .pr35739~
%patch18 -p0 -b .rh251682~
%patch19 -p0 -b .pr35899~
%patch20 -p0 -b .pr35907~
tar xzf %{SOURCE4}
@ -1662,6 +1666,15 @@ fi
%doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog
* Wed Apr 16 2008 Jakub Jelinek <jakub@redhat.com> 4.3.0-7
- update from gcc-4_3-branch
- PRs c++/35708, c++/35734, libstdc++/35816, middle-end/35519,
rtl-optimization/34916, target/35364, target/35695,
tree-optimization/35821, tree-optimization/35833
- fix libgfortran buffer overflows
- fix restoring of Altivec registers when alloca is used (PR target/35907)
- misc fixes (PRs tree-optimization/35899, target/35662, c/35739)
* Fri Apr 4 2008 Jakub Jelinek <jakub@redhat.com> 4.3.0-6
- update from gcc-4_3-branch
- PRs ada/33857, c++/35245, c++/35741, c/35738, fortran/35698,

View File

@ -1,2 +1,2 @@
37e8ad834b055b24825a9c1fe383576e gcc-4.3.0-20080404.tar.bz2
36b379b0224f3db16e47389d6c1f11c6 gcc-4.3.0-20080416.tar.bz2
92a70f9e56223b653bce0f58f90cf950 fastjar-0.95.tar.gz