This commit is contained in:
Jakub Jelinek 2008-11-05 10:15:48 +00:00
parent 5565b20a6b
commit d69d1f8218
7 changed files with 305 additions and 6 deletions

View File

@ -1,2 +1,2 @@
gcc-4.3.2-20081008.tar.bz2
gcc-4.3.2-20081105.tar.bz2
fastjar-0.95.tar.gz

32
gcc43-pr37858.patch Normal file
View File

@ -0,0 +1,32 @@
2008-11-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/37858
* passes.c (execute_one_pass): Don't look at cfun->curr_properties
for ipa and simple ipa passes.
* gcc.dg/pr37858.c: New test.
--- gcc/passes.c (revision 141544)
+++ gcc/passes.c (revision 141545)
@@ -1289,6 +1289,7 @@ execute_one_pass (struct opt_pass *pass)
if (initializing_dump
&& dump_file
&& graph_dump_format != no_graph
+ && cfun
&& (cfun->curr_properties & (PROP_cfg | PROP_rtl))
== (PROP_cfg | PROP_rtl))
{
--- gcc/testsuite/gcc.dg/pr37858.c (revision 0)
+++ gcc/testsuite/gcc.dg/pr37858.c (revision 141545)
@@ -0,0 +1,11 @@
+/* PR middle-end/37858 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-early_local_cleanups -dv" } */
+
+int
+main (void)
+{
+ return 0;
+}
+
+/* { dg-final { cleanup-ipa-dump "early_local_cleanups" } } */

79
gcc43-pr37870.patch Normal file
View File

@ -0,0 +1,79 @@
2008-10-29 Jakub Jelinek <jakub@redhat.com>
PR middle-end/37870
* expmed.c (extract_bit_field_1): If int_mode_for_mode returns
BLKmode for non-memory, convert using a wider MODE_INT mode
or through memory.
* gcc.target/i386/pr37870.c: New test.
--- gcc/expmed.c (revision 141429)
+++ gcc/expmed.c (revision 141430)
@@ -1278,9 +1278,8 @@ extract_bit_field_1 (rtx str_rtx, unsign
{
if (MEM_P (op0))
op0 = adjust_address (op0, imode, 0);
- else
+ else if (imode != BLKmode)
{
- gcc_assert (imode != BLKmode);
op0 = gen_lowpart (imode, op0);
/* If we got a SUBREG, force it into a register since we
@@ -1288,6 +1287,24 @@ extract_bit_field_1 (rtx str_rtx, unsign
if (GET_CODE (op0) == SUBREG)
op0 = force_reg (imode, op0);
}
+ else if (REG_P (op0))
+ {
+ rtx reg, subreg;
+ imode = smallest_mode_for_size (GET_MODE_BITSIZE (GET_MODE (op0)),
+ MODE_INT);
+ reg = gen_reg_rtx (imode);
+ subreg = gen_lowpart_SUBREG (GET_MODE (op0), reg);
+ emit_move_insn (subreg, op0);
+ op0 = reg;
+ bitnum += SUBREG_BYTE (subreg) * BITS_PER_UNIT;
+ }
+ else
+ {
+ rtx mem = assign_stack_temp (GET_MODE (op0),
+ GET_MODE_SIZE (GET_MODE (op0)), 0);
+ emit_move_insn (mem, op0);
+ op0 = adjust_address (mem, BLKmode, 0);
+ }
}
}
--- gcc/testsuite/gcc.target/i386/pr37870.c (revision 0)
+++ gcc/testsuite/gcc.target/i386/pr37870.c (revision 141430)
@@ -0,0 +1,29 @@
+/* PR middle-end/37870 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+unsigned int
+foo (long double x)
+{
+ struct { char a[8]; unsigned int b:7; } c;
+ __builtin_memcpy (&c, &x, sizeof (c));
+ return c.b;
+}
+
+unsigned int
+bar (long double x)
+{
+ union { struct { char a[8]; unsigned int b:7; } c; long double d; } u;
+ u.d = x;
+ return u.c.b;
+}
+
+int
+main (void)
+{
+ if (foo (1.245L) != bar (1.245L)
+ || foo (245.67L) != bar (245.67L)
+ || foo (0.00567L) != bar (0.00567L))
+ __builtin_abort ();
+ return 0;
+}

59
gcc43-pr37879.patch Normal file
View File

@ -0,0 +1,59 @@
2008-10-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/37879
* predict.c (tree_estimate_probability): Check if last_stmt is
non-NULL before dereferencing it.
* gcc.dg/pr37879.c: New test.
--- gcc/predict.c (revision 141389)
+++ gcc/predict.c (revision 141390)
@@ -1374,6 +1374,7 @@ tree_estimate_probability (void)
{
edge e;
edge_iterator ei;
+ tree last;
FOR_EACH_EDGE (e, ei, bb->succs)
{
@@ -1396,7 +1397,8 @@ tree_estimate_probability (void)
&& e->dest != EXIT_BLOCK_PTR
&& single_succ_p (e->dest)
&& single_succ_edge (e->dest)->dest == EXIT_BLOCK_PTR
- && TREE_CODE (last_stmt (e->dest)) == RETURN_EXPR)
+ && (last = last_stmt (e->dest)) != NULL_TREE
+ && TREE_CODE (last) == RETURN_EXPR)
{
edge e1;
edge_iterator ei1;
--- gcc/testsuite/gcc.dg/pr37879.c (revision 0)
+++ gcc/testsuite/gcc.dg/pr37879.c (revision 141390)
@@ -0,0 +1,28 @@
+/* PR tree-optimization/37879 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static inline void bar (int) __attribute__ ((noreturn));
+void baz () __attribute__ ((noreturn));
+
+inline int
+foo (int i)
+{
+ return i;
+}
+
+int i = 23;
+static inline void
+bar (int j)
+{
+ if (j)
+ asm ("");
+} /* { dg-warning "does return" } */
+
+void
+baz ()
+{
+ int j;
+ bar (foo (j = i++));
+ asm ("");
+}

106
gcc43-pr37924.patch Normal file
View File

@ -0,0 +1,106 @@
2008-10-28 Jakub Jelinek <jakub@redhat.com>
PR c/37924
* combine.c (make_compound_operation): Don't call make_extraction with
non-positive length.
(simplify_shift_const_1): Canonicalize count even if complement_p.
* gcc.c-torture/execute/pr37924.c: New test.
--- gcc/combine.c (revision 141412)
+++ gcc/combine.c (revision 141413)
@@ -7024,7 +7024,8 @@ make_compound_operation (rtx x, enum rtx
if (GET_CODE (rhs) == CONST_INT
&& GET_CODE (lhs) == ASHIFT
&& GET_CODE (XEXP (lhs, 1)) == CONST_INT
- && INTVAL (rhs) >= INTVAL (XEXP (lhs, 1)))
+ && INTVAL (rhs) >= INTVAL (XEXP (lhs, 1))
+ && INTVAL (rhs) < mode_width)
{
new = make_compound_operation (XEXP (lhs, 0), next_code);
new = make_extraction (mode, new,
@@ -7044,6 +7045,7 @@ make_compound_operation (rtx x, enum rtx
&& (OBJECT_P (SUBREG_REG (lhs))))
&& GET_CODE (rhs) == CONST_INT
&& INTVAL (rhs) < HOST_BITS_PER_WIDE_INT
+ && INTVAL (rhs) < mode_width
&& (new = extract_left_shift (lhs, INTVAL (rhs))) != 0)
new = make_extraction (mode, make_compound_operation (new, next_code),
0, NULL_RTX, mode_width - INTVAL (rhs),
@@ -9023,11 +9025,6 @@ simplify_shift_const_1 (enum rtx_code co
if (GET_CODE (varop) == CLOBBER)
return NULL_RTX;
- /* If we discovered we had to complement VAROP, leave. Making a NOT
- here would cause an infinite loop. */
- if (complement_p)
- break;
-
/* Convert ROTATERT to ROTATE. */
if (code == ROTATERT)
{
@@ -9073,6 +9070,11 @@ simplify_shift_const_1 (enum rtx_code co
}
}
+ /* If we discovered we had to complement VAROP, leave. Making a NOT
+ here would cause an infinite loop. */
+ if (complement_p)
+ break;
+
/* An arithmetic right shift of a quantity known to be -1 or 0
is a no-op. */
if (code == ASHIFTRT
--- gcc/testsuite/gcc.c-torture/execute/pr37924.c (revision 0)
+++ gcc/testsuite/gcc.c-torture/execute/pr37924.c (revision 141413)
@@ -0,0 +1,50 @@
+/* PR c/37924 */
+
+extern void abort (void);
+
+signed char a;
+unsigned char b;
+
+int
+test1 (void)
+{
+ int c = -1;
+ return ((unsigned int) (a ^ c)) >> 9;
+}
+
+int
+test2 (void)
+{
+ int c = -1;
+ return ((unsigned int) (b ^ c)) >> 9;
+}
+
+int
+main (void)
+{
+ a = 0;
+ if (test1 () != (-1U >> 9))
+ abort ();
+ a = 0x40;
+ if (test1 () != (-1U >> 9))
+ abort ();
+ a = 0x80;
+ if (test1 () != (a < 0) ? 0 : (-1U >> 9))
+ abort ();
+ a = 0xff;
+ if (test1 () != (a < 0) ? 0 : (-1U >> 9))
+ abort ();
+ b = 0;
+ if (test2 () != (-1U >> 9))
+ abort ();
+ b = 0x40;
+ if (test2 () != (-1U >> 9))
+ abort ();
+ b = 0x80;
+ if (test2 () != (-1U >> 9))
+ abort ();
+ b = 0xff;
+ if (test2 () != (-1U >> 9))
+ abort ();
+ return 0;
+}

View File

@ -1,9 +1,9 @@
%define DATE 20081008
%define SVNREV 140973
%define DATE 20081105
%define SVNREV 141601
%define gcc_version 4.3.2
# Note, gcc_release must be integer, if you want to add suffixes to
# %{release}, append them after %{gcc_release} on Release: line.
%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
@ -161,6 +161,10 @@ Patch24: gcc43-pr29609.patch
Patch25: gcc43-aes.patch
Patch26: gcc43-pr29609-2.patch
Patch27: gcc43-pr29609-3.patch
Patch28: gcc43-pr37870.patch
Patch29: gcc43-pr37858.patch
Patch30: gcc43-pr37879.patch
Patch31: gcc43-pr37924.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
# target triple.
@ -472,6 +476,10 @@ which are required to run programs compiled with the GNAT.
%patch25 -p0 -b .aes~
%patch26 -p0 -b .pr29609-2~
%patch27 -p0 -b .pr29609-3~
%patch28 -p0 -b .pr37870~
%patch29 -p0 -b .pr37858~
%patch30 -p0 -b .pr37879~
%patch31 -p0 -b .pr37924~
tar xzf %{SOURCE4}
@ -640,7 +648,10 @@ CC="$CC" CFLAGS="$OPT_FLAGS" CXXFLAGS="`echo $OPT_FLAGS | sed 's/ -Wall / /g'`"
%else
--enable-java-awt=gtk --disable-dssi --enable-plugin \
--with-java-home=%{_prefix}/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre \
--enable-libgcj-multifile --enable-java-maintainer-mode \
--enable-libgcj-multifile \
%if !%{bootstrap_java}
--enable-java-maintainer-mode \
%endif
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar \
--disable-libjava-multilib \
%endif
@ -1721,6 +1732,18 @@ fi
%doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog
* Wed Nov 5 2008 Jakub Jelinek <jakub@redhat.com> 4.3.2-7
- update from gcc-4_3-branch
- PRs c/35437, fortran/35680, fortran/37723, fortran/37749, fortran/37787,
fortran/37794, fortran/37903, libfortran/37707, libfortran/37863,
middle-end/37882, other/37897, rtl-optimization/37769, target/37909,
target/37939, tree-optimization/37102
- fix ICE in extract_bit_field_1 (PR middle-end/37870)
- combiner fix for shifts (PR c/37924)
- fix -fdump-ipa-all -dv (PR middle-end/37858)
- fix ICE with wrong use of noreturn attribute (PR tree-optimization/37879)
- fix up --with-java_bootstrap build
* Thu Oct 9 2008 Jakub Jelinek <jakub@redhat.com> 4.3.2-6
- fix fallouts from the -g -O0 debugging patch (#466169, #466198)

View File

@ -1,2 +1,2 @@
39dfde91a766f447711d967c4806da89 gcc-4.3.2-20081008.tar.bz2
eb9ce8c6f929283bc91c93a6087e8ced gcc-4.3.2-20081105.tar.bz2
92a70f9e56223b653bce0f58f90cf950 fastjar-0.95.tar.gz