aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-02 17:58:33 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-02 17:58:33 +0000
commite60884ed0378e66935c4b8975a7a37977366b4d0 (patch)
treebb73c881497c18bbaba63924b4fe378bf5766903
parentdea5eae2914e0f7684c5f09e8c1f84da96b42b74 (diff)
svn merge -r120062:120325 svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_1-branch@120350 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog25
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/config/ia64/ia64.c59
-rw-r--r--gcc/dwarf2out.c21
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-io.c2
-rw-r--r--gcc/testsuite/ChangeLog21
-rw-r--r--gcc/testsuite/g++.dg/eh/ia64-2.C57
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr29612-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr29612-2.c18
-rw-r--r--gcc/testsuite/gfortran.dg/write_fmt_trim.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/write_zero_array.f9017
-rw-r--r--gcc/version.c2
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/directives.c2
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/io/transfer.c2
17 files changed, 253 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65334e7eef3..f0c8c752e7c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,28 @@
+2006-12-27 Ian Lance Taylor <iant@google.com>
+
+ PR debug/26964
+ * dwarf2out.c (gen_type_die): Don't write out a DIE for
+ ENUMERAL_TYPE if it was already written out.
+
+2006-12-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * dwarf2out.c (dbx_reg_number): Do leaf register remapping
+ only if the function is leaf.
+ (multiple_reg_loc_descriptor): Likewise.
+
+ Backport from mainline:
+ 2006-05-13 Nick Clifton <nickc@redhat.com>
+
+ * dwarf2out.c (dbx_reg_number): Check return value from
+ LEAF_REG_REMAP and only use it if it is valid.
+ (multiple_reg_loc_descriptor): Likewise.
+
+2006-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/30230
+ * config/ia64/ia64.c (ia64_add_bundle_selector_before): New function.
+ (bundling): Use it.
+
2006-12-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/30262
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 163cf766d24..65d42b67701 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20061220
+20070102
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 469afa6663f..584fced5d36 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -6997,6 +6997,53 @@ get_next_important_insn (rtx insn, rtx tail)
return NULL_RTX;
}
+/* Add a bundle selector TEMPLATE0 before INSN. */
+
+static void
+ia64_add_bundle_selector_before (int template0, rtx insn)
+{
+ rtx b = gen_bundle_selector (GEN_INT (template0));
+
+ ia64_emit_insn_before (b, insn);
+#if NR_BUNDLES == 10
+ if ((template0 == 4 || template0 == 5)
+ && (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)))
+ {
+ int i;
+ rtx note = NULL_RTX;
+
+ /* In .mbb and .bbb bundles, check if CALL_INSN isn't in the
+ first or second slot. If it is and has REG_EH_NOTE set, copy it
+ to following nops, as br.call sets rp to the address of following
+ bundle and therefore an EH region end must be on a bundle
+ boundary. */
+ insn = PREV_INSN (insn);
+ for (i = 0; i < 3; i++)
+ {
+ do
+ insn = next_active_insn (insn);
+ while (GET_CODE (insn) == INSN
+ && get_attr_empty (insn) == EMPTY_YES);
+ if (GET_CODE (insn) == CALL_INSN)
+ note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ else if (note)
+ {
+ int code;
+
+ gcc_assert ((code = recog_memoized (insn)) == CODE_FOR_nop
+ || code == CODE_FOR_nop_b);
+ if (find_reg_note (insn, REG_EH_REGION, NULL_RTX))
+ note = NULL_RTX;
+ else
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (note, 0),
+ REG_NOTES (insn));
+ }
+ }
+ }
+#endif
+}
+
/* The following function does insn bundling. Bundling means
inserting templates and nop insns to fit insn groups into permitted
templates. Instruction scheduling uses NDFA (non-deterministic
@@ -7278,8 +7325,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
/* We are at the start of a bundle: emit the template
(it should be defined). */
gcc_assert (template0 >= 0);
- b = gen_bundle_selector (GEN_INT (template0));
- ia64_emit_insn_before (b, nop);
+ ia64_add_bundle_selector_before (template0, nop);
/* If we have two bundle window, we make one bundle
rotation. Otherwise template0 will be undefined
(negative value). */
@@ -7305,8 +7351,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
/* The current insn is at the bundle start: emit the
template. */
gcc_assert (template0 >= 0);
- b = gen_bundle_selector (GEN_INT (template0));
- ia64_emit_insn_before (b, insn);
+ ia64_add_bundle_selector_before (template0, insn);
b = PREV_INSN (insn);
insn = b;
/* See comment above in analogous place for emitting nops
@@ -7328,8 +7373,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
/* See comment above in analogous place for emitting nops
after the insn. */
gcc_assert (template0 >= 0);
- b = gen_bundle_selector (GEN_INT (template0));
- ia64_emit_insn_before (b, insn);
+ ia64_add_bundle_selector_before (template0, insn);
b = PREV_INSN (insn);
insn = b;
template0 = template1;
@@ -7423,8 +7467,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
}
/* Put the MM-insn in the same slot of a bundle with the
same template as the original one. */
- ia64_emit_insn_before (gen_bundle_selector (GEN_INT (template0)),
- insn);
+ ia64_add_bundle_selector_before (template0, insn);
/* To put the insn in the same slot, add necessary number
of nops. */
for (j = n; j > 0; j --)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 0cd4f35425a..a6816d4f04f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -8515,7 +8515,12 @@ dbx_reg_number (rtx rtl)
gcc_assert (regno < FIRST_PSEUDO_REGISTER);
#ifdef LEAF_REG_REMAP
- regno = LEAF_REG_REMAP (regno);
+ if (current_function_uses_only_leaf_regs)
+ {
+ int leaf_reg = LEAF_REG_REMAP (regno);
+ if (leaf_reg != -1)
+ regno = (unsigned) leaf_reg;
+ }
#endif
return DBX_REGISTER_NUMBER (regno);
@@ -8584,7 +8589,12 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs)
reg = REGNO (rtl);
#ifdef LEAF_REG_REMAP
- reg = LEAF_REG_REMAP (reg);
+ if (current_function_uses_only_leaf_regs)
+ {
+ int leaf_reg = LEAF_REG_REMAP (reg);
+ if (leaf_reg != -1)
+ reg = (unsigned) leaf_reg;
+ }
#endif
gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
@@ -12570,7 +12580,12 @@ gen_type_die (tree type, dw_die_ref context_die)
}
if (TREE_CODE (type) == ENUMERAL_TYPE)
- gen_enumeration_type_die (type, context_die);
+ {
+ /* This might have been written out by the call to
+ declare_in_namespace. */
+ if (!TREE_ASM_WRITTEN (type))
+ gen_enumeration_type_die (type, context_die);
+ }
else
gen_struct_or_union_type_die (type, context_die);
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 400e4e6808b..4d91153fd5b 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/30200
+ * trans-io.c (build_dt): Move post block for format_expr to end.
+
2006-12-13 Steven G. Kargl <kargl@gcc.gnu.org>
Revert Paul Thomas' commit from 2006-12-09
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index ab166e6e4e5..c590df9f5eb 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -1417,7 +1417,7 @@ build_dt (tree function, gfc_code * code)
dt->advance);
if (dt->format_expr)
- mask |= set_string (&block, &post_block, var, IOPARM_dt_format,
+ mask |= set_string (&block, &post_end_block, var, IOPARM_dt_format,
dt->format_expr);
if (dt->format_label)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8d6241301a4..de31faa1d69 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,24 @@
+2006-12-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/29612
+ * gcc.dg/cpp/pr29612-1.c: New test.
+ * gcc.dg/cpp/pr29612-2.c: New test.
+
+2006-12-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/30145
+ * gfortran.dg/write_zero_array.f90: New test.
+
+2006-12-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/30200
+ * gfortran.dg/write_fmt_trim.f90: New test.
+
+2006-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/30230
+ * g++.dg/eh/ia64-2.C: New test.
+
2006-12-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/30262
diff --git a/gcc/testsuite/g++.dg/eh/ia64-2.C b/gcc/testsuite/g++.dg/eh/ia64-2.C
new file mode 100644
index 00000000000..0390bc88305
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/ia64-2.C
@@ -0,0 +1,57 @@
+// PR target/30230
+// This testcase failed on IA-64, where end of an EH region ended
+// in the middle of a bundle (with br.call insn in first or second
+// slot of .bbb/.mbb bundles and EH region end right after it).
+// But br.call returns to the start of the next bundlem so during
+// unwinding the call was considered to be outside of the EH region
+// while it should have been inside.
+// { dg-options "-O2" }
+// { dg-do run }
+
+struct A {};
+struct B { virtual ~B(); };
+B::~B () {}
+struct C { void foo (short &, B &); };
+struct D { void *d1; C *d2; virtual void virt (void) {} };
+struct E { D *e1; B *e2; };
+struct F { void bar (void *, B &); };
+F *p __attribute__((weak));
+volatile int r;
+
+void C::foo (short &x, B &)
+{
+ if (r)
+ throw A ();
+ x = 1;
+}
+
+void F::bar (void *, B &)
+{
+ throw A ();
+}
+
+void baz (E &x)
+{
+ short g = 0;
+ B b = *x.e2;
+ x.e1->d2->foo (g, b);
+ if (g)
+ p->bar(x.e1->d1, b);
+}
+
+int main ()
+{
+ F g;
+ D s;
+ E h;
+ p = &g;
+ h.e1 = &s;
+ try
+ {
+ baz (h);
+ }
+ catch (A &)
+ {
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/cpp/pr29612-1.c b/gcc/testsuite/gcc.dg/cpp/pr29612-1.c
new file mode 100644
index 00000000000..f840c3823a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr29612-1.c
@@ -0,0 +1,15 @@
+/* PR preprocessor/29612 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+# 6 "pr29612-1.c"
+
+int foo (void) { return 'ab'; } /* { dg-warning "multi-character" } */
+
+# 1 "foo.h" 1 3
+
+int bar (void) { return 'ab'; } /* No warning in system header. */
+
+# 14 "pr29612-1.c" 2
+
+int baz (void) { return 'ab'; } /* { dg-warning "multi-character" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/pr29612-2.c b/gcc/testsuite/gcc.dg/cpp/pr29612-2.c
new file mode 100644
index 00000000000..813eb77af13
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr29612-2.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/29612 */
+/* { dg-do preprocess } */
+/* { dg-options "-Wtraditional -fno-show-column" } */
+
+# 6 "pr29612-2.c"
+
+#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#endif
+
+# 1 "foo.h" 1 3
+
+#if 1U
+#endif /* No warning in system header. */
+
+# 16 "pr29612-2.c" 2
+
+#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#endif
diff --git a/gcc/testsuite/gfortran.dg/write_fmt_trim.f90 b/gcc/testsuite/gfortran.dg/write_fmt_trim.f90
new file mode 100644
index 00000000000..62f1af17444
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/write_fmt_trim.f90
@@ -0,0 +1,10 @@
+! { dg-do run }
+! PR30200 write(*,myfmt="(1X,a,'xyz')") "A" prints Az' instead of Axyz
+! Test case from PR, submitted by <jvdelisle@gcc.gnu.org>
+program main
+ character (len=20) format
+ format = "(1X,a,'xyz')"
+ write(*,fmt=trim(format)) "A" ! Problem arose when trim was included here
+end
+! { dg-output " Axyz" }
+
diff --git a/gcc/testsuite/gfortran.dg/write_zero_array.f90 b/gcc/testsuite/gfortran.dg/write_zero_array.f90
new file mode 100644
index 00000000000..da7afc1426c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/write_zero_array.f90
@@ -0,0 +1,17 @@
+! { dg-do run }
+! PR30145 write statement fails to ignore zero-sized array
+! Test case from PR, submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+program zeros
+ implicit none
+ character(20) :: msg = ""
+ integer :: itemp(10) = 0
+ integer :: ics
+ !This was OK
+ write(msg,*) 'itemp(6:0) = ',itemp(6:0),'a'
+ if (msg /= " itemp(6:0) = a") call abort()
+ !This did not work before patch, segfaulted
+ ics=6
+ write(msg,*) 'itemp(ics:0) = ',itemp(ics:0),'a'
+ if (msg /= " itemp(ics:0) = a") call abort()
+end program zeros
+
diff --git a/gcc/version.c b/gcc/version.c
index cc524d85658..291ef6c5ac0 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -8,7 +8,7 @@
in parentheses. You may also wish to include a number indicating
the revision of your modified compiler. */
-#define VERSUFFIX " (Red Hat 4.1.1-48)"
+#define VERSUFFIX " (Red Hat 4.1.1-49)"
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 77708da3038..16b24ab7265 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/29612
+ * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
+ only when new_sysp is non-zero.
+
2006-06-09 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/27746
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 4bed3d8ca4a..28f03230585 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -943,8 +943,8 @@ do_linemarker (cpp_reader *pfile)
flag = read_flag (pfile, flag);
if (flag == 4)
new_sysp = 2;
- pfile->buffer->sysp = new_sysp;
}
+ pfile->buffer->sysp = new_sysp;
check_eol (pfile);
}
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 731b55db315..3ff43b0815c 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/30145
+ * io/transfer.c (transfer_array): Check for negative extent.
+
2006-12-06 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/29810
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 5e5446a0b5d..a3b337c789f 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -1216,7 +1216,7 @@ transfer_array (st_parameter_dt *dtp, gfc_array_char *desc, int kind,
/* If the extent of even one dimension is zero, then the entire
array section contains zero elements, so we return. */
- if (extent[n] == 0)
+ if (extent[n] <= 0)
return;
}