4.3.0-0.4

This commit is contained in:
Jakub Jelinek 2007-12-20 17:17:48 +00:00
parent 9389c66798
commit 26315c4d94
14 changed files with 517 additions and 438 deletions

View File

@ -1,2 +1,2 @@
gcc-4.3.0-20071212.tar.bz2
gcc-4.3.0-20071220.tar.bz2
fastjar-0.95.tar.gz

View File

@ -1,16 +0,0 @@
--- gcc/ada/Make-lang.in.jj 2007-12-07 14:47:58.000000000 +0100
+++ gcc/ada/Make-lang.in 2007-12-14 13:20:46.000000000 +0100
@@ -286,11 +286,11 @@ TARGET_ADA_SRCS =
# Since the RTL should be built with the latest compiler, remove the
# stamp target in the parent directory whenever gnat1 is rebuilt
gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBDEPS)
- $(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBS) $(SYSLIBS)
+ $(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) $(ALL_CFLAGS) $(LIBS) $(SYSLIBS)
$(RM) stamp-gnatlib2 stamp-tools
gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS)
- $(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) $(LIBS) $(SYSLIBS)
+ $(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) $(ALL_CFLAGS) $(LIBS) $(SYSLIBS)
# use cross-gcc
gnat-cross: force

View File

@ -1,30 +0,0 @@
--- libjava/classpath/configure.ac (revision 130691)
+++ libjava/classpath/configure.ac (working copy)
@@ -294,14 +294,14 @@ CLASSPATH_TOOLEXECLIBDIR
dnl -----------------------------------------------------------
dnl Sets the native libraries installation dir
dnl -----------------------------------------------------------
-dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}-${libgcj_soversion}
+dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
AC_ARG_WITH([native-libdir],
[AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
[
nativeexeclibdir=${withval}
],
[
- nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[[^#]].*:/ { print $1 }' ${srcdir}/../libtool-version`
+ nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
])
AC_SUBST(nativeexeclibdir)
--- libjava/classpath/configure (revision 130691)
+++ libjava/classpath/configure (working copy)
@@ -4771,7 +4771,7 @@ if test "${with_native_libdir+set}" = se
else
- nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[^#].*:/ { print $1 }' ${srcdir}/../libtool-version`
+ nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
fi;

View File

@ -1,22 +0,0 @@
--- libjava/testsuite/Makefile.am 2007-02-07 13:07:16.000000000 +0100
+++ libjava/testsuite/Makefile.am 2007-12-08 10:58:02.000000000 +0100
@@ -43,7 +43,7 @@ if JAVA_MAINTAINER_MODE
testdep="libjava.loader/MyLoader.java";; \
libjava.jni/register2.java) \
;; \
- libjava.jni/*.java) \
+ libjava.jni/*.java|libjava.jvmti/interp/*.java) \
genheader=-jni;; \
libjava.jvmti/*.java|libjava.cni/*.java) \
genheader=-cni;; \
--- libjava/testsuite/Makefile.in 2007-09-04 23:09:37.000000000 +0200
+++ libjava/testsuite/Makefile.in 2007-12-08 10:58:25.000000000 +0100
@@ -558,7 +558,7 @@ compile-tests:
@JAVA_MAINTAINER_MODE_TRUE@ testdep="libjava.loader/MyLoader.java";; \
@JAVA_MAINTAINER_MODE_TRUE@ libjava.jni/register2.java) \
@JAVA_MAINTAINER_MODE_TRUE@ ;; \
-@JAVA_MAINTAINER_MODE_TRUE@ libjava.jni/*.java) \
+@JAVA_MAINTAINER_MODE_TRUE@ libjava.jni/*.java|libjava.jvmti/interp/*.java) \
@JAVA_MAINTAINER_MODE_TRUE@ genheader=-jni;; \
@JAVA_MAINTAINER_MODE_TRUE@ libjava.jvmti/*.java|libjava.cni/*.java) \
@JAVA_MAINTAINER_MODE_TRUE@ genheader=-cni;; \

159
gcc43-pr29484.patch Normal file
View File

@ -0,0 +1,159 @@
2007-12-20 Jakub Jelinek <jakub@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;
+}

View File

@ -1,64 +0,0 @@
2007-12-14 Jakub Jelinek <jakub@redhat.com>
PR target/29978
* config/i386/i386.c (ix86_expand_branch): Optimize LE/LEU/GT/GTU
DImode comparisons against constant with all 1's in the lower word.
* gcc.target/i386/pr29978.c: New test.
--- gcc/config/i386/i386.c.jj 2007-12-14 00:26:23.000000000 +0100
+++ gcc/config/i386/i386.c 2007-12-14 14:14:51.000000000 +0100
@@ -12093,16 +12093,28 @@ ix86_expand_branch (enum rtx_code code,
/* Otherwise, if we are doing less-than or greater-or-equal-than,
op1 is a constant and the low word is zero, then we can just
- examine the high word. */
+ examine the high word. Similarly for low word -1 and
+ less-or-equal-than or greater-than. */
- if (CONST_INT_P (hi[1]) && lo[1] == const0_rtx)
+ if (CONST_INT_P (hi[1]))
switch (code)
{
case LT: case LTU: case GE: case GEU:
- ix86_compare_op0 = hi[0];
- ix86_compare_op1 = hi[1];
- ix86_expand_branch (code, label);
- return;
+ if (lo[1] == const0_rtx)
+ {
+ ix86_compare_op0 = hi[0];
+ ix86_compare_op1 = hi[1];
+ ix86_expand_branch (code, label);
+ return;
+ }
+ case LE: case LEU: case GT: case GTU:
+ if (lo[1] == constm1_rtx)
+ {
+ ix86_compare_op0 = hi[0];
+ ix86_compare_op1 = hi[1];
+ ix86_expand_branch (code, label);
+ return;
+ }
default:
break;
}
--- gcc/testsuite/gcc.target/i386/pr29978.c.jj 2007-12-14 14:26:17.000000000 +0100
+++ gcc/testsuite/gcc.target/i386/pr29978.c 2007-12-14 14:26:04.000000000 +0100
@@ -0,0 +1,16 @@
+/* PR target/29978 */
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+void g ();
+
+void
+f (long long v)
+{
+ if (v > 0xfffffffffLL)
+ g ();
+ g ();
+}
+
+/* Verify there are no redundant jumps jl .L2; jle .L2 */
+/* { dg-final { scan-assembler-not "jl\[^e\]*\\.L" { target ilp32 } } } */

View File

@ -1,25 +0,0 @@
2007-12-11 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/32636
* df-scan.c (df_get_entry_block_def_set): Set struct_value_rtx
regno in entry_block_defs even if HAVE_prologue && epilogue_completed.
--- gcc/df-scan.c.jj 2007-10-26 13:45:44.000000000 +0200
+++ gcc/df-scan.c 2007-12-11 22:24:21.000000000 +0100
@@ -3530,12 +3530,12 @@ df_get_entry_block_def_set (bitmap entry
bitmap_set_bit (entry_block_defs, STATIC_CHAIN_REGNUM);
#endif
#endif
-
- r = targetm.calls.struct_value_rtx (current_function_decl, true);
- if (r && REG_P (r))
- bitmap_set_bit (entry_block_defs, REGNO (r));
}
+ r = targetm.calls.struct_value_rtx (current_function_decl, true);
+ if (r && REG_P (r))
+ bitmap_set_bit (entry_block_defs, REGNO (r));
+
if ((!reload_completed) || frame_pointer_needed)
{
/* Any reference to any pseudo before reload is a potential

View File

@ -1,80 +0,0 @@
2007-12-13 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/34003
* c-decl.c (merge_decls): Copy RTL from olddecl to newdecl.
* config/pa/pa.c (pa_encode_section_info): If !first, preserve
SYMBOL_FLAG_REFERENCED flag.
* gcc.dg/pr34003-1.c: New test.
* gcc.dg/pr34003-2.c: New.
--- gcc/c-decl.c.jj 2007-11-26 22:14:08.000000000 +0100
+++ gcc/c-decl.c 2007-12-13 20:11:33.000000000 +0100
@@ -1670,6 +1670,9 @@ merge_decls (tree newdecl, tree olddecl,
}
}
+ /* Keep the old rtl since we can safely use it. */
+ if (HAS_RTL_P (olddecl))
+ COPY_DECL_RTL (olddecl, newdecl);
/* Merge the type qualifiers. */
if (TREE_READONLY (newdecl))
--- gcc/config/pa/pa.c.jj 2007-12-13 18:56:21.000000000 +0100
+++ gcc/config/pa/pa.c 2007-12-13 20:32:04.000000000 +0100
@@ -7834,6 +7834,12 @@ hppa_encode_label (rtx sym)
static void
pa_encode_section_info (tree decl, rtx rtl, int first)
{
+ int old_referenced = 0;
+
+ if (!first && MEM_P (rtl) && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF)
+ old_referenced
+ = SYMBOL_REF_FLAGS (XEXP (rtl, 0)) & SYMBOL_FLAG_REFERENCED;
+
default_encode_section_info (decl, rtl, first);
if (first && TEXT_SPACE_P (decl))
@@ -7842,6 +7848,8 @@ pa_encode_section_info (tree decl, rtx r
if (TREE_CODE (decl) == FUNCTION_DECL)
hppa_encode_label (XEXP (rtl, 0));
}
+ else if (old_referenced)
+ SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= old_referenced;
}
/* This is sort of inverse to pa_encode_section_info. */
--- gcc/testsuite/gcc.dg/pr34003-1.c.jj 2007-12-13 21:07:51.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr34003-1.c 2007-12-13 21:07:15.000000000 +0100
@@ -0,0 +1,8 @@
+/* PR bootstrap/34003 */
+/* { dg-do link } */
+/* { dg-options "-O0" } */
+/* { dg-additional-sources "pr34003-2.c" } */
+
+extern void foo (void);
+int bar (void) { foo (); return 1; }
+extern void foo (void);
--- gcc/testsuite/gcc.dg/pr34003-2.c.jj 2007-12-13 21:07:59.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr34003-2.c 2007-12-13 21:09:35.000000000 +0100
@@ -0,0 +1,20 @@
+/* PR bootstrap/34003 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+extern void abort (void);
+
+int seen = 0;
+
+void foo (void)
+{
+ ++seen;
+}
+
+int main (void)
+{
+ extern int bar (void);
+ if (bar () != 1 || seen != 1)
+ abort ();
+ return 0;
+}

92
gcc43-pr34281.patch Normal file
View File

@ -0,0 +1,92 @@
2007-12-13 Jakub Jelinek <jakub@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;
+}

View File

@ -1,198 +0,0 @@
2007-12-12 Jakub Jelinek <jakub@redhat.com>
PR libfortran/34427
Revert:
2007-12-08 Tobias Burnus <burnus@net-b.de>
PR fortran/34319
* io/list_read.c (parse_real, read_real): Support NaN/Infinity.
* gfortran.dg/nan_3.f90: New.
--- libgfortran/io/list_read.c (revision 130708)
+++ libgfortran/io/list_read.c (revision 130707)
@@ -1078,12 +1078,7 @@ parse_real (st_parameter_dt *dtp, void *
}
if (!isdigit (c) && c != '.')
- {
- if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
- goto inf_nan;
- else
- goto bad;
- }
+ goto bad;
push_char (dtp, c);
@@ -1141,13 +1136,7 @@ parse_real (st_parameter_dt *dtp, void *
exp2:
if (!isdigit (c))
- {
- if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
- goto inf_nan;
- else
- goto bad;
- }
-
+ goto bad;
push_char (dtp, c);
for (;;)
@@ -1177,41 +1166,6 @@ parse_real (st_parameter_dt *dtp, void *
return m;
- inf_nan:
- /* Match INF and Infinity. */
- if ((c == 'i' || c == 'I')
- && ((c = next_char (dtp)) == 'n' || c == 'N')
- && ((c = next_char (dtp)) == 'f' || c == 'F'))
- {
- c = next_char (dtp);
- if ((c != 'i' && c != 'I')
- || ((c == 'i' || c == 'I')
- && ((c = next_char (dtp)) == 'n' || c == 'N')
- && ((c = next_char (dtp)) == 'i' || c == 'I')
- && ((c = next_char (dtp)) == 't' || c == 'T')
- && ((c = next_char (dtp)) == 'y' || c == 'Y')
- && (c = next_char (dtp))))
- {
- if (is_separator (c))
- unget_char (dtp, c);
- push_char (dtp, 'i');
- push_char (dtp, 'n');
- push_char (dtp, 'f');
- goto done;
- }
- } /* Match NaN. */
- else if (((c = next_char (dtp)) == 'a' || c == 'A')
- && ((c = next_char (dtp)) == 'n' || c == 'N')
- && (c = next_char (dtp)))
- {
- if (is_separator (c))
- unget_char (dtp, c);
- push_char (dtp, 'n');
- push_char (dtp, 'a');
- push_char (dtp, 'n');
- goto done;
- }
-
bad:
if (nml_bad_return (dtp, c))
@@ -1339,12 +1293,6 @@ read_real (st_parameter_dt *dtp, int len
eat_separator (dtp);
return;
- case 'i':
- case 'I':
- case 'n':
- case 'N':
- goto inf_nan;
-
default:
goto bad_real;
}
@@ -1419,12 +1367,7 @@ read_real (st_parameter_dt *dtp, int len
}
if (!isdigit (c) && c != '.')
- {
- if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
- goto inf_nan;
- else
- goto bad_real;
- }
+ goto bad_real;
if (c == '.')
{
@@ -1521,37 +1464,6 @@ read_real (st_parameter_dt *dtp, int len
dtp->u.p.saved_type = BT_REAL;
return;
- inf_nan:
- /* Match INF and Infinity. */
- if ((c == 'i' || c == 'I')
- && ((c = next_char (dtp)) == 'n' || c == 'N')
- && ((c = next_char (dtp)) == 'f' || c == 'F'))
- {
- c = next_char (dtp);
- if (is_separator (c)
- || ((c == 'i' || c == 'I')
- && ((c = next_char (dtp)) == 'n' || c == 'N')
- && ((c = next_char (dtp)) == 'i' || c == 'I')
- && ((c = next_char (dtp)) == 't' || c == 'T')
- && ((c = next_char (dtp)) == 'y' || c == 'Y')
- && (c = next_char (dtp)) && is_separator (c)))
- {
- push_char (dtp, 'i');
- push_char (dtp, 'n');
- push_char (dtp, 'f');
- goto done;
- }
- } /* Match NaN. */
- else if (((c = next_char (dtp)) == 'a' || c == 'A')
- && ((c = next_char (dtp)) == 'n' || c == 'N')
- && (c = next_char (dtp)) && is_separator (c))
- {
- push_char (dtp, 'n');
- push_char (dtp, 'a');
- push_char (dtp, 'n');
- goto done;
- }
-
bad_real:
if (nml_bad_return (dtp, c))
--- gcc/testsuite/gfortran.dg/nan_3.f90 (revision 130708)
+++ gcc/testsuite/gfortran.dg/nan_3.f90 (revision 130707)
@@ -1,45 +0,0 @@
-! { dg-do run }
-! { dg-options "-fno-range-check" }
-! { dg-options "-fno-range-check -mieee" { target sh*-*-* } }
-!
-! PR fortran/34319
-!
-! Check support of INF/NaN for I/O.
-!
-program main
- implicit none
- real :: r
- complex :: z
- character(len=30) :: str
-
- str = "nan"
- read(str,*) r
- if (.not.isnan(r)) call abort()
- str = "(nan,4.0)"
- read(str,*) z
- if (.not.isnan(real(z)) .or. aimag(z) /= 4.0) call abort()
- str = "(7.0,nan)"
- read(str,*) z
- if (.not.isnan(aimag(z)) .or. real(z) /= 7.0) call abort()
-
- str = "inFinity"
- read(str,*) r
- if (r <= huge(r)) call abort()
- str = "(+inFinity,4.0)"
- read(str,*) z
- if ((real(z) <= huge(r)) .or. aimag(z) /= 4.0) call abort()
- str = "(7.0,-inFinity)"
- read(str,*) z
- if ((aimag(z) >= -huge(r)) .or. real(z) /= 7.0) call abort()
-
- str = "inf"
- read(str,*) r
- if (r <= huge(r)) call abort()
- str = "(+inf,4.0)"
- read(str,*) z
- if ((real(z) <= huge(r)) .or. aimag(z) /= 4.0) call abort()
- str = "(7.0,-inf)"
- read(str,*) z
- if ((aimag(z) >= -huge(r)) .or. real(z) /= 7.0) call abort()
-
-end program main

229
gcc43-pr34448.patch Normal file
View File

@ -0,0 +1,229 @@
2007-12-17 Aldy Hernandez <aldyh@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" } } */

34
gcc43-pr34535.patch Normal file
View File

@ -0,0 +1,34 @@
2007-12-20 Jakub Jelinek <jakub@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;
}

View File

@ -328,7 +328,7 @@ Requires: libart_lgpl >= 2.1.0
%if %{build_java}
BuildRequires: gtk2-devel >= 2.4.0
BuildRequires: glib2-devel >= 2.4.0
BuildRequires: firefox-devel
BuildRequires: xulrunner-devel
BuildRequires: libart_lgpl-devel >= 2.1.0
BuildRequires: alsa-lib-devel
BuildRequires: libXtst-devel

View File

@ -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