summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.melt3
-rw-r--r--gcc/ChangeLog143
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/builtins.c130
-rw-r--r--gcc/c-gimplify.c6
-rw-r--r--gcc/cfgcleanup.c5
-rw-r--r--gcc/cfgexpand.c8
-rw-r--r--gcc/cfglayout.c55
-rw-r--r--gcc/cfgrtl.c16
-rw-r--r--gcc/config/arm/bpabi.h17
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/config/i386/i386.h3
-rw-r--r--gcc/config/i386/i386.md25
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c8
-rw-r--r--gcc/cse.c19
-rw-r--r--gcc/emit-rtl.c11
-rw-r--r--gcc/fortran/ChangeLog16
-rw-r--r--gcc/fortran/array.c8
-rw-r--r--gcc/fortran/error.c26
-rw-r--r--gcc/fortran/expr.c83
-rw-r--r--gcc/fortran/gfortran.h5
-rw-r--r--gcc/fortran/intrinsic.c40
-rw-r--r--gcc/fortran/trans-types.c8
-rw-r--r--gcc/gimple-low.c6
-rw-r--r--gcc/graphite.c1
-rw-r--r--gcc/rtl.h1
-rw-r--r--gcc/sdbout.c23
-rw-r--r--gcc/testsuite/ChangeLog45
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37341.c35
-rw-r--r--gcc/testsuite/gcc.target/mips/octeon-bbit-3.c15
-rw-r--r--gcc/testsuite/gcc.target/mips/octeon-exts-2.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/octeon-exts-5.c38
-rw-r--r--gcc/testsuite/gfortran.dg/convert_2.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f901
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_54.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/restricted_expression_1.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/restricted_expression_2.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/restricted_expression_3.f9026
-rw-r--r--gcc/testsuite/lib/gfortran-dg.exp1
-rw-r--r--gcc/tree-cfg.c9
-rw-r--r--gcc/tree-ssa-live.c6
-rw-r--r--gcc/tree.h1
-rw-r--r--libgcc/ChangeLog4
-rw-r--r--libgcc/config.host17
-rw-r--r--libgfortran/ChangeLog15
-rw-r--r--libgfortran/io/list_read.c3
-rw-r--r--libgfortran/io/transfer.c8
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/xstrdup.c2
-rw-r--r--libmudflap/ChangeLog5
-rw-r--r--libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx17
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h10
54 files changed, 842 insertions, 191 deletions
diff --git a/ChangeLog.melt b/ChangeLog.melt
index be537e1ac1e..4ebb31c70fb 100644
--- a/ChangeLog.melt
+++ b/ChangeLog.melt
@@ -1,3 +1,6 @@
+2008-10-10 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk r141021
+
2008-10-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140962
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index abe7fdc4959..340f30c7a92 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,95 @@
+2008-10-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * fortran/trans-types.c (gfc_get_nodesc_array_type): Don't
+ vary types depending on debug info.
+
+2008-10-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * c-gimplify.c (c_genericize): Don't refer to DECL_ASSEMBLER_NAME
+ before ensuring it's already computed.
+
+2008-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ * rtl.h (locator_eq): New decl.
+ * cfglayout.c (locator_scope): New function.
+ (insn_scope): Use it.
+ (locator_eq): New function.
+ (fixup_reorder_chain): Search for last insn in src bb
+ that has locator set or first insn in dest bb. Use
+ locator_eq instead of == to compare locators.
+ * cfgrtl.c (cfg_layout_merge_blocks): Likewise.
+ * cfgcleanup.c (try_forward_edges): Use locator_eq instead of
+ == to compare locators.
+
+ * tree-ssa-live.c (remove_unused_locals): Mark all edge's goto_block
+ as used.
+ * gimple-low.c (lower_function_body, lower_gimple_return,
+ lower_builtin_setjmp): Set gimple_block on the newly created stmts.
+ * tree-cfg.c (make_cond_expr_edges, make_goto_expr_edges): Only set
+ goto_block on edges if goto_locus is known.
+
+ PR middle-end/37774
+ * tree.h (get_object_alignment): Declare.
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Call
+ get_object_alignment if needed.
+ * builtins.c (get_pointer_alignment): Move ADDR_EXPR operand handling
+ to ...
+ (get_object_alignment): ... here. New function. Try harder to
+ determine alignment from get_inner_reference returned offset.
+
+2008-10-08 Jakub Jelinek <jakub@redhat.com>
+
+ * graphite.c (gloog): Don't call find_unreachable_blocks
+ before delte_unreachable_blocks.
+
+ * cfgexpand.c (expand_gimple_cond): Convert also goto_block and
+ goto_locus of true_edge into RTL locator.
+
+2008-10-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*jcc_btdi_rex64): Clobber FLAGS_REG.
+ (*jcc_btdi_mask_rex64): Ditto.
+ (*jcc_btsi): Ditto.
+ (*jcc_btsi_mask): Ditto.
+ (*jcc_btsi_1): Ditto.
+ (*jcc_btsi_mask_1): Ditto.
+
+2008-10-08 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/bpabi.h (ARM_FUNCTION_PROFILER): Define new EABI
+ compatible profiler (__gnu_mcount_nc).
+ (SUBTARGET_FRAME_POINTER_REQUIRED): Define.
+
+2008-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (initial_ix86_tune_features): Add
+ X86_TUNE_USE_VECTOR_FP_CONVERTS.
+ * config/i386/i386.h (ix86_tune_indices): Likewise.
+ (TARGET_USE_VECTOR_FP_CONVERTS): New.
+
+ * config/i386/i386.md: Check TARGET_USE_VECTOR_FP_CONVERTS
+ instead of (TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ for FP to FP splitters.
+
+2008-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.md: Add missing gen_sse2_cvtdq2p to convert
+ splitter.
+
+2008-10-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/36635
+ PR target/37290
+ PR rtl-optimization/37341
+ * cse.c (cse_cc_succs): Add ORIG_BB argument, don't follow edges
+ to ORIG_BB, pass through ORIG_BB recursively.
+ (cse_condition_code_reg): Adjust caller.
+
+2008-10-08 Kai Tietz <kai.tietz@onevision.com>
+
+ * sdbout.c (sdbout_one_type): Treat the value type
+ CONST_DECL for enumerals.
+
2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.md: Remove trailing white spaces.
@@ -5,13 +97,15 @@
2008-10-07 Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/37448
- alloc_pool_desc (elt_size): New field.
- alloc_pool_desc (created, allocated, current, peak): Make unsigned
- long.
- output_info (count): Renamed total_created and made unsigned long.
- output_info (size): Renamed total_allocated and made unsigned long.
- alloc-pool.c (create_alloc_pool, empty_alloc_pool, pool_alloc,
- pool_free): Properly keep track of desc->size.
+ * alloc-pool.c (struct alloc_pool_descriptor) [elt_size]: New field.
+ (stuct alloc_pool_descriptor) [created, allocated, current, peak]:
+ Make unsigned long.
+ (struct output_info) [count]: Renamed total_created and made
+ unsigned long.
+ (struct output_info) [size]: Renamed total_allocated and made
+ unsigned long.
+ (create_alloc_pool, empty_alloc_pool, pool_alloc, pool_free):
+ Properly keep track of desc->size.
(print_statistics, dump_alloc_pool_statistics): Enhance the
printing of statistics to print the number of elements and to use
unsigned longs.
@@ -237,8 +331,7 @@
(print_operand_address): Always use output_addr_const for
constant pool addresses.
(rs6000_output_addr_const_extra): New function.
- (create_TOC_reference): Create an UNSPEC_TOCREL instead of
- a MINUS.
+ (create_TOC_reference): Create an UNSPEC_TOCREL instead of a MINUS.
2008-10-06 Vladimir Makarov <vmakarov@redhat.com>
@@ -340,10 +433,8 @@
* config/rs6000/rs6000.c (USE_FP_FOR_ARG_P): Revert
TARGET_DOUBLE_FLOAT, TARGET_SINGLE_FLOAT.
(function_arg_advance): Condition on TARGET_DOUBLE_FLOAT,
- TARGET_SINGLE_FLOAT.
- Revert SCALAR_FLOAT_MODE_P condition.
- (function_arg): Condition on TARGET_DOUBLE_FLOAT,
- TARGET_SINGLE_FLOAT.
+ TARGET_SINGLE_FLOAT. Revert SCALAR_FLOAT_MODE_P condition.
+ (function_arg): Condition on TARGET_DOUBLE_FLOAT, TARGET_SINGLE_FLOAT.
(rs6000_function_value): Revert TARGET_DOUBLE_FLOAT,
TARGET_SINGLE_FLOAT.
@@ -383,8 +474,8 @@
(vec_promote): Define.
2008-10-01 Andrew Pinski <andrew_pinski@playstation.sony.com>
- Yukishige Shibata <shibata@rd.scei.sony.co.jp>
- Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
+ Yukishige Shibata <shibata@rd.scei.sony.co.jp>
+ Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add Cell
Altivec intrinsics.
@@ -991,8 +1082,8 @@
2008-09-22 Adam Nemet <anemet@caviumnetworks.com>
* config/mips/mips.h (ISA_HAS_BADDU): New macro.
- * config/mips/mips.md (*baddu_si_eb, *baddu_si_el,
- *baddu_di<mode>): New patterns.
+ * config/mips/mips.md (*baddu_si_eb, *baddu_si_el, *baddu_di<mode>):
+ New patterns.
2008-09-22 Richard Guenther <rguenther@suse.de>
@@ -1025,8 +1116,7 @@
PR target/37528
* config/i386/t-cygming (SHLIB_LC): Remove.
(SHLIB_LINK): Don't add static objects to SHLIB_IMPLIB
- * config/i386/t-cygwin (SHLIB_LC): Specify all required
- libraries.
+ * config/i386/t-cygwin (SHLIB_LC): Specify all required libraries.
2008-09-22 Hans-Peter Nilsson <hp@axis.com>
@@ -1086,8 +1176,7 @@
(SSA Operands): Rename from 'Statement Operands'.
* doc/generic.texi: New.
* doc/gimple.texi: New.
- * Makefile.in (TEXI_GCCINT_FILES): Add generic.texi and
- gimple.texi.
+ * Makefile.in (TEXI_GCCINT_FILES): Add generic.texi and gimple.texi.
* Makefile.in (TEXI_GCCINT_FILES):
* gimple.c (gimple_copy_call_skip_args): Rename from
giple_copy_call_skip_args. Update all users.
@@ -1364,8 +1453,7 @@
2008-09-18 Alexander Monakov <amonakov@ispras.ru>
PR middle-end/37499
- * sched-int.h (struct _haifa_insn_data): Remove unused field
- ref_count.
+ * sched-int.h (struct _haifa_insn_data): Remove unused field ref_count.
* sched-rgn.c (ref_counts): Remove.
(insn_referenced): New static variable.
@@ -1379,8 +1467,7 @@
* haifa-sched.c (dep_cost_1): Recognize the producer even if the
consumer is an asm. Add comment why this is important.
(choose_ready): Add comment to the "INSN_CODE (insn) >= 0 ||
- recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around
- it.
+ recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around it.
2008-09-17 Joseph Myers <joseph@codesourcery.com>
@@ -2689,10 +2776,8 @@
* ira-emit.c (change_loop): Use all_allocnos.
- * ira-build.c (create_loop_tree_nodes, finish_loop_tree_node):
- Ditto.
- (ira_create_allocno): Set up all_allocnos bit for the created
- allocno.
+ * ira-build.c (create_loop_tree_nodes, finish_loop_tree_node): Ditto.
+ (ira_create_allocno): Set up all_allocnos bit for the created allocno.
(create_cap_allocno): Remove setting mentioned_allocnos.
(create_insn_allocnos): Ditto.
(remove_unnecessary_allocnos): Use all_allocnos.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 12db959fdbc..d00fb2d2188 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20081008
+20081010
diff --git a/gcc/builtins.c b/gcc/builtins.c
index ea1a16d9bdd..5ed60bb0531 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -253,6 +253,82 @@ static bool called_as_built_in (tree node)
return false;
}
+/* Return the alignment in bits of EXP, an object.
+ Don't return more than MAX_ALIGN no matter what, ALIGN is the inital
+ guessed alignment e.g. from type alignment. */
+
+int
+get_object_alignment (tree exp, unsigned int align, unsigned int max_align)
+{
+ unsigned int inner;
+
+ inner = max_align;
+ if (handled_component_p (exp))
+ {
+ HOST_WIDE_INT bitsize, bitpos;
+ tree offset;
+ enum machine_mode mode;
+ int unsignedp, volatilep;
+
+ exp = get_inner_reference (exp, &bitsize, &bitpos, &offset,
+ &mode, &unsignedp, &volatilep, true);
+ if (bitpos)
+ inner = MIN (inner, (unsigned) (bitpos & -bitpos));
+ while (offset)
+ {
+ tree next_offset;
+
+ if (TREE_CODE (offset) == PLUS_EXPR)
+ {
+ next_offset = TREE_OPERAND (offset, 0);
+ offset = TREE_OPERAND (offset, 1);
+ }
+ else
+ next_offset = NULL;
+ if (host_integerp (offset, 1))
+ {
+ /* Any overflow in calculating offset_bits won't change
+ the alignment. */
+ unsigned offset_bits
+ = ((unsigned) tree_low_cst (offset, 1) * BITS_PER_UNIT);
+
+ if (offset_bits)
+ inner = MIN (inner, (offset_bits & -offset_bits));
+ }
+ else if (TREE_CODE (offset) == MULT_EXPR
+ && host_integerp (TREE_OPERAND (offset, 1), 1))
+ {
+ /* Any overflow in calculating offset_factor won't change
+ the alignment. */
+ unsigned offset_factor
+ = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1)
+ * BITS_PER_UNIT);
+
+ if (offset_factor)
+ inner = MIN (inner, (offset_factor & -offset_factor));
+ }
+ else
+ {
+ inner = MIN (inner, BITS_PER_UNIT);
+ break;
+ }
+ offset = next_offset;
+ }
+ }
+ if (DECL_P (exp))
+ align = MIN (inner, DECL_ALIGN (exp));
+#ifdef CONSTANT_ALIGNMENT
+ else if (CONSTANT_CLASS_P (exp))
+ align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
+#endif
+ else if (TREE_CODE (exp) == VIEW_CONVERT_EXPR
+ || TREE_CODE (exp) == INDIRECT_REF)
+ align = MIN (TYPE_ALIGN (TREE_TYPE (exp)), inner);
+ else
+ align = MIN (align, inner);
+ return MIN (align, max_align);
+}
+
/* Return the alignment in bits of EXP, a pointer valued expression.
But don't return more than MAX_ALIGN no matter what.
The alignment returned is, by default, the alignment of the thing that
@@ -306,59 +382,7 @@ get_pointer_alignment (tree exp, unsigned int max_align)
case ADDR_EXPR:
/* See what we are pointing at and look at its alignment. */
- exp = TREE_OPERAND (exp, 0);
- inner = max_align;
- if (handled_component_p (exp))
- {
- HOST_WIDE_INT bitsize, bitpos;
- tree offset;
- enum machine_mode mode;
- int unsignedp, volatilep;
-
- exp = get_inner_reference (exp, &bitsize, &bitpos, &offset,
- &mode, &unsignedp, &volatilep, true);
- if (bitpos)
- inner = MIN (inner, (unsigned) (bitpos & -bitpos));
- if (offset && TREE_CODE (offset) == PLUS_EXPR
- && host_integerp (TREE_OPERAND (offset, 1), 1))
- {
- /* Any overflow in calculating offset_bits won't change
- the alignment. */
- unsigned offset_bits
- = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1)
- * BITS_PER_UNIT);
-
- if (offset_bits)
- inner = MIN (inner, (offset_bits & -offset_bits));
- offset = TREE_OPERAND (offset, 0);
- }
- if (offset && TREE_CODE (offset) == MULT_EXPR
- && host_integerp (TREE_OPERAND (offset, 1), 1))
- {
- /* Any overflow in calculating offset_factor won't change
- the alignment. */
- unsigned offset_factor
- = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1)
- * BITS_PER_UNIT);
-
- if (offset_factor)
- inner = MIN (inner, (offset_factor & -offset_factor));
- }
- else if (offset)
- inner = MIN (inner, BITS_PER_UNIT);
- }
- if (DECL_P (exp))
- align = MIN (inner, DECL_ALIGN (exp));
-#ifdef CONSTANT_ALIGNMENT
- else if (CONSTANT_CLASS_P (exp))
- align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
-#endif
- else if (TREE_CODE (exp) == VIEW_CONVERT_EXPR
- || TREE_CODE (exp) == INDIRECT_REF)
- align = MIN (TYPE_ALIGN (TREE_TYPE (exp)), inner);
- else
- align = MIN (align, inner);
- return MIN (align, max_align);
+ return get_object_alignment (TREE_OPERAND (exp, 0), align, max_align);
default:
return align;
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c
index 342848acd29..5b309343361 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -2,7 +2,8 @@
by the C-based front ends. The structure of gimplified, or
language-independent, trees is dictated by the grammar described in this
file.
- Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Lowering of expressions contributed by Sebastian Pop <s.pop@laposte.net>
Re-written to support lowering of whole function trees, documentation
and miscellaneous cleanups by Diego Novillo <dnovillo@redhat.com>
@@ -87,7 +88,8 @@ c_genericize (tree fndecl)
fprintf (dump_orig, "\n;; Function %s",
lang_hooks.decl_printable_name (fndecl, 2));
fprintf (dump_orig, " (%s)\n",
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
+ (!DECL_ASSEMBLER_NAME_SET_P (fndecl) ? "null"
+ : IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl))));
fprintf (dump_orig, ";; enabled by -%s\n", dump_flag_name (TDI_original));
fprintf (dump_orig, "\n");
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 8b9756def21..190bde66848 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -483,7 +483,7 @@ try_forward_edges (int mode, basic_block b)
blocks with different locus are not optimized out. */
int locus = single_succ_edge (target)->goto_locus;
- if (locus && goto_locus && locus != goto_locus)
+ if (locus && goto_locus && !locator_eq (locus, goto_locus))
counter = n_basic_blocks;
else if (locus)
goto_locus = locus;
@@ -492,7 +492,8 @@ try_forward_edges (int mode, basic_block b)
{
locus = INSN_LOCATOR (BB_END (target));
- if (locus && goto_locus && locus != goto_locus)
+ if (locus && goto_locus
+ && !locator_eq (locus, goto_locus))
counter = n_basic_blocks;
else if (locus)
goto_locus = locus;
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index e94fe356e1c..6eaec30c98f 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1725,6 +1725,14 @@ expand_gimple_cond (basic_block bb, gimple stmt)
maybe_dump_rtl_for_gimple_stmt (stmt, last2);
+ if (true_edge->goto_locus)
+ {
+ set_curr_insn_source_location (true_edge->goto_locus);
+ set_curr_insn_block (true_edge->goto_block);
+ true_edge->goto_locus = curr_insn_locator ();
+ }
+ true_edge->goto_block = NULL;
+
ggc_free (pred);
return new_bb;
}
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index be1188d0b61..05e355d411f 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -448,13 +448,12 @@ change_scope (rtx orig_insn, tree s1, tree s2)
}
}
-/* Return lexical scope block insn belong to. */
+/* Return lexical scope block locator belongs to. */
static tree
-insn_scope (const_rtx insn)
+locator_scope (int loc)
{
int max = VEC_length (int, block_locators_locs);
int min = 0;
- int loc = INSN_LOCATOR (insn);
/* When block_locators_locs was initialized, the pro- and epilogue
insns didn't exist yet and can therefore not be found this way.
@@ -488,6 +487,13 @@ insn_scope (const_rtx insn)
return VEC_index (tree, block_locators_blocks, min);
}
+/* Return lexical scope block insn belongs to. */
+static tree
+insn_scope (const_rtx insn)
+{
+ return locator_scope (INSN_LOCATOR (insn));
+}
+
/* Return line number of the statement specified by the locator. */
static location_t
locator_location (int loc)
@@ -551,6 +557,17 @@ insn_file (const_rtx insn)
return locator_file (INSN_LOCATOR (insn));
}
+/* Return true if LOC1 and LOC2 locators have the same location and scope. */
+bool
+locator_eq (int loc1, int loc2)
+{
+ if (loc1 == loc2)
+ return true;
+ if (locator_location (loc1) != locator_location (loc2))
+ return false;
+ return locator_scope (loc1) == locator_scope (loc2);
+}
+
/* Rebuild all the NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes based
on the scope tree and the newly reordered instructions. */
@@ -900,24 +917,30 @@ fixup_reorder_chain (void)
if (e->goto_locus && !(e->flags & EDGE_ABNORMAL))
{
basic_block nb;
-
- if (simplejump_p (BB_END (e->src)))
+ rtx end;
+
+ insn = BB_END (e->src);
+ end = PREV_INSN (BB_HEAD (e->src));
+ while (insn != end
+ && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0))
+ insn = PREV_INSN (insn);
+ if (insn != end
+ && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))
+ continue;
+ if (simplejump_p (BB_END (e->src))
+ && INSN_LOCATOR (BB_END (e->src)) == 0)
{
- if (INSN_LOCATOR (BB_END (e->src)) == (int) e->goto_locus)
- continue;
- if (INSN_LOCATOR (BB_END (e->src)) == 0)
- {
- INSN_LOCATOR (BB_END (e->src)) = e->goto_locus;
- continue;
- }
+ INSN_LOCATOR (BB_END (e->src)) = e->goto_locus;
+ continue;
}
if (e->dest != EXIT_BLOCK_PTR)
{
insn = BB_HEAD (e->dest);
- if (!INSN_P (insn))
- insn = next_insn (insn);
- if (insn && INSN_P (insn)
- && INSN_LOCATOR (insn) == (int) e->goto_locus)
+ end = NEXT_INSN (BB_END (e->dest));
+ while (insn != end && !INSN_P (insn))
+ insn = NEXT_INSN (insn);
+ if (insn != end && INSN_LOCATOR (insn)
+ && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))
continue;
}
nb = split_edge (e);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 24469ebf30d..a7dc5076865 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -2615,19 +2615,21 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
some unique locus, emit a nop with that locus in between. */
if (!optimize && EDGE_SUCC (a, 0)->goto_locus)
{
- rtx insn = BB_END (a);
+ rtx insn = BB_END (a), end = PREV_INSN (BB_HEAD (a));
int goto_locus = EDGE_SUCC (a, 0)->goto_locus;
- if (NOTE_P (insn))
- insn = prev_nonnote_insn (insn);
- if (insn && INSN_P (insn) && INSN_LOCATOR (insn) == goto_locus)
+ while (insn != end && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0))
+ insn = PREV_INSN (insn);
+ if (insn != end && locator_eq (INSN_LOCATOR (insn), goto_locus))
goto_locus = 0;
else
{
insn = BB_HEAD (b);
- if (!INSN_P (insn))
- insn = next_insn (insn);
- if (insn && INSN_P (insn) && INSN_LOCATOR (insn) == goto_locus)
+ end = NEXT_INSN (BB_END (b));
+ while (insn != end && !INSN_P (insn))
+ insn = NEXT_INSN (insn);
+ if (insn != end && INSN_LOCATOR (insn) != 0
+ && locator_eq (INSN_LOCATOR (insn), goto_locus))
goto_locus = 0;
}
if (goto_locus)
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index 38be1da261a..c8cdc3db087 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -147,3 +147,20 @@
#undef FINI_SECTION_ASM_OP
#define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
#define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
+
+/* The legacy _mcount implementation assumes r11 points to a
+ 4-word APCS frame. This is generally not true for EABI targets,
+ particularly not in Thumb mode. We assume the mcount
+ implementation does not require a counter variable (No Counter).
+ Note that __gnu_mcount_nc will be entered with a misaligned stack.
+ This is OK because it uses a special calling convention anyway. */
+
+#undef ARM_FUNCTION_PROFILER
+#define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
+{ \
+ fprintf (STREAM, "\tpush\t{lr}\n"); \
+ fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n"); \
+}
+
+#undef SUBTARGET_FRAME_POINTER_REQUIRED
+#define SUBTARGET_FRAME_POINTER_REQUIRED 0
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index be371173fa2..a3d4951fafe 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1434,6 +1434,10 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
replacement is long decoded, so this split helps here as well. */
m_K6,
+ /* X86_TUNE_USE_VECTOR_FP_CONVERTS: Prefer vector packed SSE conversion
+ from FP to FP. */
+ m_AMDFAM10 | m_GENERIC,
+
/* X86_TUNE_USE_VECTOR_CONVERTS: Prefer vector packed SSE conversion
from integer to FP. */
m_AMDFAM10,
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 81a282e0553..32f793b1cf7 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -292,6 +292,7 @@ enum ix86_tune_indices {
X86_TUNE_MOVE_M1_VIA_OR,
X86_TUNE_NOT_UNPAIRABLE,
X86_TUNE_NOT_VECTORMODE,
+ X86_TUNE_USE_VECTOR_FP_CONVERTS,
X86_TUNE_USE_VECTOR_CONVERTS,
X86_TUNE_FUSE_CMP_AND_BRANCH,
@@ -375,6 +376,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
#define TARGET_MOVE_M1_VIA_OR ix86_tune_features[X86_TUNE_MOVE_M1_VIA_OR]
#define TARGET_NOT_UNPAIRABLE ix86_tune_features[X86_TUNE_NOT_UNPAIRABLE]
#define TARGET_NOT_VECTORMODE ix86_tune_features[X86_TUNE_NOT_VECTORMODE]
+#define TARGET_USE_VECTOR_FP_CONVERTS \
+ ix86_tune_features[X86_TUNE_USE_VECTOR_FP_CONVERTS]
#define TARGET_USE_VECTOR_CONVERTS \
ix86_tune_features[X86_TUNE_USE_VECTOR_CONVERTS]
#define TARGET_FUSE_CMP_AND_BRANCH \
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 88040fc2201..9d1a01a8e69 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -4216,7 +4216,7 @@
[(set (match_operand:DF 0 "register_operand" "")
(float_extend:DF
(match_operand:SF 1 "nonimmediate_operand" "")))]
- "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ "TARGET_USE_VECTOR_FP_CONVERTS
&& optimize_insn_for_speed_p ()
&& reload_completed && SSE_REG_P (operands[0])"
[(set (match_dup 2)
@@ -4356,7 +4356,7 @@
[(set (match_operand:SF 0 "register_operand" "")
(float_truncate:SF
(match_operand:DF 1 "nonimmediate_operand" "")))]
- "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ "TARGET_USE_VECTOR_FP_CONVERTS
&& optimize_insn_for_speed_p ()
&& reload_completed && SSE_REG_P (operands[0])"
[(set (match_dup 2)
@@ -5391,6 +5391,9 @@
operands[4] = simplify_gen_subreg (V4SImode, operands[1], SImode, 0);
else
gcc_unreachable ();
+ emit_insn
+ (gen_sse2_cvtdq2p<ssemodefsuffix> (operands[3], operands[4]));
+ DONE;
})
(define_split
@@ -14331,7 +14334,8 @@
(match_operand:QI 2 "register_operand" "r")))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))"
"#"
"&& 1"
@@ -14363,7 +14367,8 @@
(match_operand:SI 2 "register_operand" "r")
(match_operand:SI 3 "const_int_operand" "n")))])
(label_ref (match_operand 4 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x3f) == 0x3f"
"#"
@@ -14395,7 +14400,8 @@
(match_operand:QI 2 "register_operand" "r")))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_USE_BT || optimize_function_for_size_p (cfun)"
"#"
"&& 1"
@@ -14427,7 +14433,8 @@
(match_operand:SI 2 "register_operand" "r")
(match_operand:SI 3 "const_int_operand" "n")))])
(label_ref (match_operand 4 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"(TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x1f) == 0x1f"
"#"
@@ -14455,7 +14462,8 @@
(const_int 1))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_USE_BT || optimize_function_for_size_p (cfun)"
"#"
"&& 1"
@@ -14491,7 +14499,8 @@
(const_int 1))
(const_int 0)])
(label_ref (match_operand 4 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"(TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x1f) == 0x1f"
"#"
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bb4b6b21bed..6ad8a8a6ad5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37568
+ * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
+ setting it to error_mark_node.
+
2008-10-07 Steve Ellcey <sje@cup.hp.com>
* decl.c (start_cleanup_fn): Declare as inline.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index b1bbb38dfa8..040a9b10c35 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3310,13 +3310,11 @@ finalize_nrv_r (tree* tp, int* walk_subtrees, void* data)
tree init;
if (DECL_INITIAL (dp->var)
&& DECL_INITIAL (dp->var) != error_mark_node)
- {
- init = build2 (INIT_EXPR, void_type_node, dp->result,
- DECL_INITIAL (dp->var));
- DECL_INITIAL (dp->var) = error_mark_node;
- }
+ init = build2 (INIT_EXPR, void_type_node, dp->result,
+ DECL_INITIAL (dp->var));
else
init = build_empty_stmt ();
+ DECL_INITIAL (dp->var) = NULL_TREE;
SET_EXPR_LOCUS (init, EXPR_LOCUS (*tp));
*tp = init;
}
diff --git a/gcc/cse.c b/gcc/cse.c
index b911879bf79..f4bd77e4700 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1,6 +1,6 @@
/* Common subexpression elimination for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
@@ -603,7 +603,8 @@ static bool set_live_p (rtx, rtx, int *);
static int cse_change_cc_mode (rtx *, void *);
static void cse_change_cc_mode_insn (rtx, rtx);
static void cse_change_cc_mode_insns (rtx, rtx, rtx);
-static enum machine_mode cse_cc_succs (basic_block, rtx, rtx, bool);
+static enum machine_mode cse_cc_succs (basic_block, basic_block, rtx, rtx,
+ bool);
#undef RTL_HOOKS_GEN_LOWPART
@@ -6587,13 +6588,17 @@ cse_change_cc_mode_insns (rtx start, rtx end, rtx newreg)
permitted to change the mode of CC_SRC to a compatible mode. This
returns VOIDmode if no equivalent assignments were found.
Otherwise it returns the mode which CC_SRC should wind up with.
+ ORIG_BB should be the same as BB in the outermost cse_cc_succs call,
+ but is passed unmodified down to recursive calls in order to prevent
+ endless recursion.
The main complexity in this function is handling the mode issues.
We may have more than one duplicate which we can eliminate, and we
try to find a mode which will work for multiple duplicates. */
static enum machine_mode
-cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
+cse_cc_succs (basic_block bb, basic_block orig_bb, rtx cc_reg, rtx cc_src,
+ bool can_change_mode)
{
bool found_equiv;
enum machine_mode mode;
@@ -6624,7 +6629,9 @@ cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
continue;
if (EDGE_COUNT (e->dest->preds) != 1
- || e->dest == EXIT_BLOCK_PTR)
+ || e->dest == EXIT_BLOCK_PTR
+ /* Avoid endless recursion on unreachable blocks. */
+ || e->dest == orig_bb)
continue;
end = NEXT_INSN (BB_END (e->dest));
@@ -6729,7 +6736,7 @@ cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
{
enum machine_mode submode;
- submode = cse_cc_succs (e->dest, cc_reg, cc_src, false);
+ submode = cse_cc_succs (e->dest, orig_bb, cc_reg, cc_src, false);
if (submode != VOIDmode)
{
gcc_assert (submode == mode);
@@ -6857,7 +6864,7 @@ cse_condition_code_reg (void)
the basic block. */
orig_mode = GET_MODE (cc_src);
- mode = cse_cc_succs (bb, cc_reg, cc_src, true);
+ mode = cse_cc_succs (bb, bb, cc_reg, cc_src, true);
if (mode != VOIDmode)
{
gcc_assert (mode == GET_MODE (cc_src));
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 318ae775330..4564a0b7485 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1564,6 +1564,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
if (! TYPE_P (t))
{
tree base;
+ bool align_computed = false;
if (TREE_THIS_VOLATILE (t))
MEM_VOLATILE_P (ref) = 1;
@@ -1620,6 +1621,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
&& host_integerp (DECL_SIZE_UNIT (t), 1)
? GEN_INT (tree_low_cst (DECL_SIZE_UNIT (t), 1)) : 0);
align = DECL_ALIGN (t);
+ align_computed = true;
}
/* If this is a constant, we know the alignment. */
@@ -1629,6 +1631,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
#ifdef CONSTANT_ALIGNMENT
align = CONSTANT_ALIGNMENT (t, align);
#endif
+ align_computed = true;
}
/* If this is a field reference and not a bit-field, record it. */
@@ -1688,6 +1691,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
align = DECL_ALIGN (t2);
if (aoff && (unsigned HOST_WIDE_INT) aoff < align)
align = aoff;
+ align_computed = true;
offset = GEN_INT (ioff);
apply_bitpos = bitpos;
}
@@ -1721,6 +1725,13 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
expr = t;
offset = NULL;
}
+
+ if (!align_computed && !INDIRECT_REF_P (t))
+ {
+ unsigned int obj_align
+ = get_object_alignment (t, align, BIGGEST_ALIGNMENT);
+ align = MAX (align, obj_align);
+ }
}
/* If we modified OFFSET based on T, then subtract the outstanding
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index b0ef1cef8be..a2ca844018c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,19 @@
+2008-10-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/35723
+ * gfortran.h (gfc_suppress_error): Removed from header.
+ (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
+ * array.c (gfc_array_size): Use new gfc_push/pop_suppress_errors
+ instead of directly changing gfc_suppress_error.
+ * intrinsic.c (gfc_intrinsic_func_interface): Ditto.
+ (gfc_intrinsic_sub_interface): Ditto.
+ * error.c (suppress_errors): Made static from `gfc_suppress_error'.
+ (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
+ (gfc_notify_std), (gfc_error): Use new static name of global.
+ * expr.c (check_arglist), (check_references): New methods.
+ (check_restricted): Check arglists and references of EXPR_FUNCTIONs
+ and EXPR_VARAIBALEs, respectively. Allow PARAMETER symbols.
+
2008-10-07 Jakub Jelinek <jakub@redhat.com>
* f95-lang.c (poplevel): Don't clear BLOCK_VARS if functionbody.
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index d99ed9e30a0..70cf66294da 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -2073,14 +2073,13 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
{
expand_info expand_save;
gfc_ref *ref;
- int i, flag;
+ int i;
gfc_try t;
switch (array->expr_type)
{
case EXPR_ARRAY:
- flag = gfc_suppress_error;
- gfc_suppress_error = 1;
+ gfc_push_suppress_errors ();
expand_save = current_expand;
@@ -2091,7 +2090,8 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
iter_stack = NULL;
t = expand_constructor (array->value.constructor);
- gfc_suppress_error = flag;
+
+ gfc_pop_suppress_errors ();
if (t == FAILURE)
mpz_clear (*result);
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 7a5fbd34711..a7005e9fbb6 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -30,13 +30,33 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "gfortran.h"
-int gfc_suppress_error = 0;
+static int suppress_errors = 0;
static int terminal_width, buffer_flag, errors, warnings;
static gfc_error_buf error_buffer, warning_buffer, *cur_error_buffer;
+/* Go one level deeper suppressing errors. */
+
+void
+gfc_push_suppress_errors (void)
+{
+ gcc_assert (suppress_errors >= 0);
+ ++suppress_errors;
+}
+
+
+/* Leave one level of error suppressing. */
+
+void
+gfc_pop_suppress_errors (void)
+{
+ gcc_assert (suppress_errors > 0);
+ --suppress_errors;
+}
+
+
/* Per-file error initialization. */
void
@@ -764,7 +784,7 @@ gfc_notify_std (int std, const char *nocmsgid, ...)
if ((gfc_option.allow_std & std) != 0 && !warning)
return SUCCESS;
- if (gfc_suppress_error)
+ if (suppress_errors)
return warning ? SUCCESS : FAILURE;
cur_error_buffer = warning ? &warning_buffer : &error_buffer;
@@ -850,7 +870,7 @@ gfc_error (const char *nocmsgid, ...)
{
va_list argp;
- if (gfc_suppress_error)
+ if (suppress_errors)
return;
error_buffer.flag = 1;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 7f6bf1b07e4..5a167b7067f 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2503,6 +2503,64 @@ restricted_intrinsic (gfc_expr *e)
}
+/* Check the expressions of an actual arglist. Used by check_restricted. */
+
+static gfc_try
+check_arglist (gfc_actual_arglist* arg, gfc_try (*checker) (gfc_expr*))
+{
+ for (; arg; arg = arg->next)
+ if (checker (arg->expr) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+/* Check the subscription expressions of a reference chain with a checking
+ function; used by check_restricted. */
+
+static gfc_try
+check_references (gfc_ref* ref, gfc_try (*checker) (gfc_expr*))
+{
+ int dim;
+
+ if (!ref)
+ return SUCCESS;
+
+ switch (ref->type)
+ {
+ case REF_ARRAY:
+ for (dim = 0; dim != ref->u.ar.dimen; ++dim)
+ {
+ if (checker (ref->u.ar.start[dim]) == FAILURE)
+ return FAILURE;
+ if (checker (ref->u.ar.end[dim]) == FAILURE)
+ return FAILURE;
+ if (checker (ref->u.ar.stride[dim]) == FAILURE)
+ return FAILURE;
+ }
+ break;
+
+ case REF_COMPONENT:
+ /* Nothing needed, just proceed to next reference. */
+ break;
+
+ case REF_SUBSTRING:
+ if (checker (ref->u.ss.start) == FAILURE)
+ return FAILURE;
+ if (checker (ref->u.ss.end) == FAILURE)
+ return FAILURE;
+ break;
+
+ default:
+ gcc_unreachable ();
+ break;
+ }
+
+ return check_references (ref->next, checker);
+}
+
+
/* Verify that an expression is a restricted expression. Like its
cousin check_init_expr(), an error message is generated if we
return FAILURE. */
@@ -2510,7 +2568,7 @@ restricted_intrinsic (gfc_expr *e)
static gfc_try
check_restricted (gfc_expr *e)
{
- gfc_symbol *sym;
+ gfc_symbol* sym;
gfc_try t;
if (e == NULL)
@@ -2526,8 +2584,22 @@ check_restricted (gfc_expr *e)
break;
case EXPR_FUNCTION:
- t = e->value.function.esym ? external_spec_function (e)
- : restricted_intrinsic (e);
+ if (e->value.function.esym)
+ {
+ t = check_arglist (e->value.function.actual, &check_restricted);
+ if (t == SUCCESS)
+ t = external_spec_function (e);
+ }
+ else
+ {
+ if (e->value.function.isym && e->value.function.isym->inquiry)
+ t = SUCCESS;
+ else
+ t = check_arglist (e->value.function.actual, &check_restricted);
+
+ if (t == SUCCESS)
+ t = restricted_intrinsic (e);
+ }
break;
case EXPR_VARIABLE:
@@ -2561,6 +2633,10 @@ check_restricted (gfc_expr *e)
break;
}
+ /* Check reference chain if any. */
+ if (check_references (e->ref, &check_restricted) == FAILURE)
+ break;
+
/* gfc_is_formal_arg broadcasts that a formal argument list is being
processed in resolve.c(resolve_formal_arglist). This is done so
that host associated dummy array indices are accepted (PR23446).
@@ -2571,6 +2647,7 @@ check_restricted (gfc_expr *e)
|| sym->attr.use_assoc
|| sym->attr.dummy
|| sym->attr.implied_index
+ || sym->attr.flavor == FL_PARAMETER
|| (sym->ns && sym->ns == gfc_current_ns->parent)
|| (sym->ns && gfc_current_ns->parent
&& sym->ns == gfc_current_ns->parent->parent)
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index b032486abfd..42f5516b746 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -770,7 +770,10 @@ typedef struct
#endif
-extern int gfc_suppress_error;
+/* Suppress error messages or re-enable them. */
+
+void gfc_push_suppress_errors (void);
+void gfc_pop_suppress_errors (void);
/* Character length structures hold the expression that gives the
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 035aef70d65..7acdcb05e60 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -3598,7 +3598,8 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
return (do_simplify (expr->value.function.isym, expr) == FAILURE)
? MATCH_ERROR : MATCH_YES;
- gfc_suppress_error = !error_flag;
+ if (!error_flag)
+ gfc_push_suppress_errors ();
flag = 0;
for (actual = expr->value.function.actual; actual; actual = actual->next)
@@ -3611,7 +3612,8 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
isym = specific = gfc_find_function (name);
if (isym == NULL)
{
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
@@ -3621,7 +3623,11 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
&& gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Function '%s' "
"as initialization expression at %L", name,
&expr->where) == FAILURE)
- return MATCH_ERROR;
+ {
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
+ return MATCH_ERROR;
+ }
gfc_current_intrinsic_where = &expr->where;
@@ -3633,7 +3639,8 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
if (gfc_check_min_max (expr->value.function.actual) == SUCCESS)
goto got_specific;
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
@@ -3641,7 +3648,7 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
incarnations. If the generic name is also a specific, we check
that name last, so that any error message will correspond to the
specific. */
- gfc_suppress_error = 1;
+ gfc_push_suppress_errors ();
if (isym->generic)
{
@@ -3651,15 +3658,19 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
if (specific == isym)
continue;
if (check_specific (specific, expr, 0) == SUCCESS)
- goto got_specific;
+ {
+ gfc_pop_suppress_errors ();
+ goto got_specific;
+ }
}
}
- gfc_suppress_error = !error_flag;
+ gfc_pop_suppress_errors ();
if (check_specific (isym, expr, error_flag) == FAILURE)
{
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
@@ -3669,7 +3680,9 @@ got_specific:
expr->value.function.isym = specific;
gfc_intrinsic_symbol (expr->symtree->n.sym);
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
+
if (do_simplify (specific, expr) == FAILURE)
return MATCH_ERROR;
@@ -3709,7 +3722,8 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
if (isym == NULL)
return MATCH_NO;
- gfc_suppress_error = !error_flag;
+ if (!error_flag)
+ gfc_push_suppress_errors ();
init_arglist (isym);
@@ -3729,7 +3743,8 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
/* The subroutine corresponds to an intrinsic. Allow errors to be
seen at this point. */
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
if (isym->resolve.s1 != NULL)
isym->resolve.s1 (c);
@@ -3751,7 +3766,8 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
return MATCH_YES;
fail:
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index c3d2a918040..c4c83143777 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1415,10 +1415,10 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed)
mpz_clear (stride);
mpz_clear (delta);
- /* In debug info represent packed arrays as multi-dimensional
- if they have rank > 1 and with proper bounds, instead of flat
- arrays. */
- if (known_offset && write_symbols != NO_DEBUG)
+ /* Represent packed arrays as multi-dimensional if they have rank >
+ 1 and with proper bounds, instead of flat arrays. This makes for
+ better debug info. */
+ if (known_offset)
{
tree gtype = etype, rtype, type_decl;
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 99f8754473b..197ba352b45 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -133,6 +133,7 @@ lower_function_body (void)
{
x = gimple_build_return (NULL);
gimple_set_location (x, cfun->function_end_locus);
+ gimple_set_block (x, DECL_INITIAL (current_function_decl));
gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
}
@@ -659,6 +660,7 @@ lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
found:
t = gimple_build_goto (tmp_rs.label);
gimple_set_location (t, gimple_location (stmt));
+ gimple_set_block (t, gimple_block (stmt));
gsi_insert_before (gsi, t, GSI_SAME_STMT);
gsi_remove (gsi, false);
}
@@ -736,6 +738,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
t = implicit_built_in_decls[BUILT_IN_SETJMP_SETUP];
g = gimple_build_call (t, 2, gimple_call_arg (stmt, 0), arg);
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Build 'DEST = 0' and insert. */
@@ -744,6 +747,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
integer_zero_node));
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
}
@@ -760,6 +764,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
t = implicit_built_in_decls[BUILT_IN_SETJMP_RECEIVER];
g = gimple_build_call (t, 1, arg);
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Build 'DEST = 1' and insert. */
@@ -768,6 +773,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
integer_one_node));
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
}
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 4531936b154..a615e2c1e49 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -4162,7 +4162,6 @@ gloog (scop_p scop, struct clast_stmt *stmt)
if (new_scop_exit_edge->dest == EXIT_BLOCK_PTR)
new_scop_exit_edge->flags = 0;
- find_unreachable_blocks ();
delete_unreachable_blocks ();
patch_phis_for_virtual_defs ();
patch_scop_exit_phi_args (new_scop_exit_edge, phi_args);
diff --git a/gcc/rtl.h b/gcc/rtl.h
index fd855e9c650..118025a4ff0 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1639,6 +1639,7 @@ extern int insn_line (const_rtx);
extern const char * insn_file (const_rtx);
extern int locator_line (int);
extern const char * locator_file (int);
+extern bool locator_eq (int, int);
extern int prologue_locator, epilogue_locator;
/* In jump.c */
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index e6f14fa2f78..fe08a0b6361 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -1177,14 +1177,21 @@ sdbout_one_type (tree type)
if (TREE_CODE (type) == ENUMERAL_TYPE)
{
for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
- if (host_integerp (TREE_VALUE (tem), 0))
- {
- PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
- PUT_SDB_INT_VAL (tree_low_cst (TREE_VALUE (tem), 0));
- PUT_SDB_SCL (C_MOE);
- PUT_SDB_TYPE (T_MOE);
- PUT_SDB_ENDEF;
- }
+ {
+ tree value = TREE_VALUE (tem);
+
+ if (TREE_CODE (value) == CONST_DECL)
+ value = DECL_INITIAL (value);
+
+ if (host_integerp (value, 0))
+ {
+ PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
+ PUT_SDB_INT_VAL (tree_low_cst (value, 0));
+ PUT_SDB_SCL (C_MOE);
+ PUT_SDB_TYPE (T_MOE);
+ PUT_SDB_ENDEF;
+ }
+ }
}
else /* record or union type */
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cc7ec163e07..4232c498102 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,48 @@
+2008-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37707
+ * gfortran.dg/namelist_54.f90: Revise test, check a(3).
+
+2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/37753
+ * gfortran.dg/convert_2.f90: New test case.
+
+2008-10-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/35723
+ * gfortran.dg/restricted_expression_1.f90: New test.
+ * gfortran.dg/restricted_expression_2.f90: New test.
+ * gfortran.dg/restricted_expression_3.f90: New test.
+
+2008-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37707
+ * gfortran.dg/namelist_54.f90: New test.
+
+2008-10-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/vect/ggc-pr37574.c: Cleanup "vect" tree dump.
+ * gfortran.dg/intrinsic_optional_char_arg_1.f90: Cleanup
+ "original" tree dump.
+
+ * lib/gfortran-dg.exp (gfortran-dg-debug-runtest): Remove build
+ file trivial.S.
+
+2008-10-08 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/octeon-exts-2.c: Compile it with -meb.
+ * gcc.target/mips/octeon-exts-5.c: New test.
+ * gcc.target/mips/octeon-bbit-3.c: Compile with -meb. Add
+ comment why this is necessary.
+
+2008-10-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/36635
+ PR target/37290
+ PR rtl-optimization/37341
+ * gcc.c-torture/compile/pr37341.c: New test.
+
2008-10-07 Simon Martin <simartin@users.sourceforge.net>
PR c/35437
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37341.c b/gcc/testsuite/gcc.c-torture/compile/pr37341.c
new file mode 100644
index 00000000000..adbf0c7e484
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37341.c
@@ -0,0 +1,35 @@
+/* PR rtl-optimization/37341 */
+
+short int a;
+int b;
+
+static inline int
+f1 (int x, int y)
+{
+ if (x < 0 || y < 0 || y >= sizeof (int) * 8 || x > (1 >> y))
+ return x;
+}
+
+static inline unsigned int
+f2 (int x, int y)
+{
+ if (y <= 0 && x && y < __INT_MAX__ / x)
+ return x;
+ return x * y;
+}
+
+int
+f3 (void)
+{
+ return (signed char) 0xb6;
+}
+
+unsigned int
+f4 (unsigned int x)
+{
+ while (1)
+ {
+ if ((f2 (f3 (), (f1 (a, b)))) < x)
+ return 1;
+ }
+}
diff --git a/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c
index ac8d0ca5c7a..fd01f12181d 100644
--- a/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c
+++ b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c
@@ -1,5 +1,18 @@
/* { dg-do compile } */
-/* { dg-mips-options "-O2 -march=octeon" } */
+
+/* Force big-endian because for little-endian, combine generates this:
+
+ (if_then_else (ne (zero_extract:DI (subreg:DI (truncate:SI (reg:DI 196)) 0)
+ (const_int 1)
+ (const_int 0))
+ (const_int 0))
+ (label_ref 20)
+ (pc)))
+
+ which does not get recognized as a valid bbit pattern. The
+ middle-end should be able to simplify this further. */
+/* { dg-mips-options "-O2 -march=octeon -meb" } */
+
/* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t" 2 } } */
/* { dg-final { scan-assembler-not "ext\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-2.c b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c
index a87c5fb45db..7847cf9411b 100644
--- a/gcc/testsuite/gcc.target/mips/octeon-exts-2.c
+++ b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-mips-options "-O -march=octeon" } */
+/* { dg-mips-options "-O -march=octeon -meb" } */
/* { dg-final { scan-assembler-times "\texts\t" 4 } } */
struct bar
diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-5.c b/gcc/testsuite/gcc.target/mips/octeon-exts-5.c
new file mode 100644
index 00000000000..31251e74763
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/octeon-exts-5.c
@@ -0,0 +1,38 @@
+/* -mel version of octeon-exts-2.c. */
+/* { dg-do compile } */
+/* { dg-mips-options "-O -march=octeon -mel" } */
+/* { dg-final { scan-assembler-times "\texts\t" 4 } } */
+
+struct bar
+{
+ long long d:1;
+ unsigned long long c:48;
+ long long b:14;
+ unsigned long long a:1;
+};
+
+NOMIPS16 int
+f1 (struct bar *s, int a)
+{
+ return (int) s->b + a;
+}
+
+NOMIPS16 char
+f2 (struct bar *s)
+{
+ return s->d + 1;
+}
+
+NOMIPS16 int
+f3 ()
+{
+ struct bar s;
+ asm ("" : "=r"(s));
+ return (int) s.b + 1;
+}
+
+NOMIPS16 long long
+f4 (struct bar *s)
+{
+ return s->d;
+}
diff --git a/gcc/testsuite/gfortran.dg/convert_2.f90 b/gcc/testsuite/gfortran.dg/convert_2.f90
new file mode 100644
index 00000000000..9f90606885a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/convert_2.f90
@@ -0,0 +1,20 @@
+! { dg-do run }
+! Check for correct ordering of character variables with CONVERT
+
+program main
+ implicit none
+ integer, parameter :: two_swap = 2**25
+ integer(kind=4) i,j
+ character(len=2) :: c,d
+ open(20,file="convert.dat",form="unformatted",convert="swap") ! { dg-warning "CONVERT" }
+ write (20) "ab"
+ close (20)
+ open(20,file="convert.dat",form="unformatted",access="stream")
+ read(20) i,c,j
+ if (i .ne. two_swap .or. j .ne. two_swap .or. c .ne. "ab") call abort
+ close (20)
+ open(20,file="convert.dat",form="unformatted",convert="swap") ! { dg-warning "CONVERT" }
+ read (20) d
+ close (20,status="delete")
+ if (d .ne. "ab") call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90
index 5352ee4bf26..3215f43fa40 100644
--- a/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90
+++ b/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90
@@ -29,3 +29,4 @@ END PROGRAM main
! { dg-final { scan-tree-dump "_eoshift\[0-9_\]+char \\(\[&a-zA-Z0-9._, \]+, 1, 0\\)" "original" } }
! { dg-final { scan-tree-dump "_reshape\[0-9_\]+char \\(\[&a-zA-Z0-9._, \]+, 1, 0\\)" "original" } }
! { dg-final { scan-tree-dump "_pack\[0-9_\]+char \\(\[&a-zA-Z0-9._, \]+, 1, 0\\)" "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/namelist_54.f90 b/gcc/testsuite/gfortran.dg/namelist_54.f90
new file mode 100644
index 00000000000..25061c48fc5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_54.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! PR37707 Namelist read of array of derived type incorrect.
+type s
+ integer m
+ integer n
+end type s
+type(s) :: a(3)
+character*80 :: l = ' &namlis a%m=1,2, a%n=5,6, /'
+namelist /namlis/ a
+a%m=[87,88,89]
+a%n=[97,98,99]
+read(l,namlis)
+if (a(1)%m /= 1 .or. a(2)%m /= 2 .or. a(1)%n /= 5 .or. a(2)%n /= 6 .or. &
+ & a(3)%m /= 89 .or. a(3)%n /= 99) call abort
+end
diff --git a/gcc/testsuite/gfortran.dg/restricted_expression_1.f90 b/gcc/testsuite/gfortran.dg/restricted_expression_1.f90
new file mode 100644
index 00000000000..45211a585f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/restricted_expression_1.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-pedantic -ffixed-form" }
+
+! PR fortran/35723
+! An argument subscript into a parameter array was not allowed as
+! dimension. Check this is fixed.
+
+! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
+
+ call vf0016( 1, 2, 3)
+
+ end
+ SUBROUTINE VF0016(nf1,nf2,nf3)
+ CHARACTER(LEN=9,KIND=1),DIMENSION(3), PARAMETER
+ $ :: TEST_STRINGS =
+ $ (/' HI','ABC ',' CDEFG '/)
+ CHARACTER :: TEST_ARRAY
+ $(LEN_TRIM(ADJUSTL(TEST_STRINGS(nf1))),
+ $ SUM(LEN_TRIM(ADJUSTL(TEST_STRINGS))),
+ $ LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(3)))),
+ $ SUM(LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(NF1:NF3:NF2))))) )
+
+ print *, 2, 10, 5, 7
+ print *, shape (test_array)
+ end
diff --git a/gcc/testsuite/gfortran.dg/restricted_expression_2.f90 b/gcc/testsuite/gfortran.dg/restricted_expression_2.f90
new file mode 100644
index 00000000000..9c281664a84
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/restricted_expression_2.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-pedantic -ffixed-form" }
+
+! PR fortran/35723
+! Check that a program using a local variable subscript is still rejected.
+
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+ call vf0016( 1, 2, 3)
+
+ end
+ SUBROUTINE VF0016(nf1,nf2,nf3)
+ CHARACTER(LEN=9,KIND=1),DIMENSION(3), PARAMETER
+ $ :: TEST_STRINGS =
+ $ (/' HI','ABC ',' CDEFG '/)
+ INTEGER :: i = 2
+ CHARACTER :: TEST_ARRAY
+ $(LEN_TRIM(ADJUSTL(TEST_STRINGS(i))), ! { dg-error "'i' cannot appear" }
+ $ SUM(LEN_TRIM(ADJUSTL(TEST_STRINGS))),
+ $ LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(3)))),
+ $ SUM(LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(NF1:NF3:NF2))))) )
+
+ print *, 2, 10, 5, 7
+ print *, shape (test_array)
+ end
diff --git a/gcc/testsuite/gfortran.dg/restricted_expression_3.f90 b/gcc/testsuite/gfortran.dg/restricted_expression_3.f90
new file mode 100644
index 00000000000..0b84f67aa58
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/restricted_expression_3.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+
+! PR fortran/35723
+! Check that a dummy-argument array with non-restricted subscript is
+! rejected and some more reference-checks.
+
+PROGRAM main
+ IMPLICIT NONE
+ CALL test (5, (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), "0123456789" )
+
+CONTAINS
+
+ SUBROUTINE test (n, arr, str)
+ IMPLICIT NONE
+ INTEGER :: n, arr(:)
+ CHARACTER(len=10) :: str
+
+ INTEGER :: i = 5
+ INTEGER :: ok1(arr(n)), ok2(LEN_TRIM (str(3:n)))
+ INTEGER :: ok3(LEN_TRIM("hello, world!"(2:n)))
+ INTEGER :: wrong1(arr(i)) ! { dg-error "'i' cannot appear" }
+ INTEGER :: wrong2(LEN_TRIM (str(i:n))) ! { dg-error "'i' cannot appear" }
+ INTEGER :: wrong3(LEN_TRIM ("hello, world!"(i:n))) ! { dg-error "'i' cannot appear" }
+ END SUBROUTINE test
+
+END PROGRAM main
diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp
index d7b1f2d7824..55d6d400c40 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -133,6 +133,7 @@ proc gfortran-dg-debug-runtest { target_compile trivial opt_opts testcases } {
} {
continue
}
+ remove-build-file "trivial.S"
foreach level {1 "" 3} {
lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
foreach opt $opt_opts {
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 505ee700057..28ee8ef40c4 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -658,12 +658,14 @@ make_cond_expr_edges (basic_block bb)
e = make_edge (bb, then_bb, EDGE_TRUE_VALUE);
e->goto_locus = gimple_location (then_stmt);
- e->goto_block = gimple_block (then_stmt);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (then_stmt);
e = make_edge (bb, else_bb, EDGE_FALSE_VALUE);
if (e)
{
e->goto_locus = gimple_location (else_stmt);
- e->goto_block = gimple_block (else_stmt);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (else_stmt);
}
/* We do not need the labels anymore. */
@@ -853,7 +855,8 @@ make_goto_expr_edges (basic_block bb)
tree dest = gimple_goto_dest (goto_t);
edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
e->goto_locus = gimple_location (goto_t);
- e->goto_block = gimple_block (goto_t);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (goto_t);
gsi_remove (&last, true);
return;
}
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 859c0c7427d..47315184f9a 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -600,6 +600,8 @@ remove_unused_locals (void)
{
gimple_stmt_iterator gsi;
size_t i;
+ edge_iterator ei;
+ edge e;
/* Walk the statements. */
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -634,6 +636,10 @@ remove_unused_locals (void)
mark_all_vars_used (&arg, NULL);
}
}
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->goto_locus)
+ TREE_USED (e->goto_block) = true;
}
/* Remove unmarked local vars from local_decls. */
diff --git a/gcc/tree.h b/gcc/tree.h
index 44bc3f0f282..034be6a35cb 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4864,6 +4864,7 @@ extern tree build_string_literal (int, const char *);
extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern int get_pointer_alignment (tree, unsigned int);
+extern int get_object_alignment (tree, unsigned int, unsigned int);
extern tree fold_call_stmt (gimple, bool);
extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 5fc628b6840..1894509429c 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-08 Thomas Schwinge <tschwinge@gnu.org>
+
+ * config.host: Fold `*-*-gnu*' cases into the Linux ones.
+
2008-09-03 Hari Sandanagobalane <hariharan@picochip.com>
Add picoChip port.
diff --git a/libgcc/config.host b/libgcc/config.host
index cf33e04de44..a92ffa04455 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -150,12 +150,9 @@ case ${host} in
# machine-specific sections may refine and add to this
# configuration.
;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
- # Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*)
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
;;
-*-*-gnu*)
- ;;
*-*-netbsd*)
;;
*-*-openbsd*)
@@ -176,12 +173,10 @@ case ${host} in
then tmake_file=${cpu_type}/t-$rest
fi
;;
-alpha*-*-linux*)
+alpha*-*-linux* | alpha*-*-gnu*)
tmake_file="${tmake_file} alpha/t-crtfm"
extra_parts="$extra_parts crtfastmath.o"
;;
-alpha*-*-gnu*)
- ;;
alpha*-*-freebsd*)
;;
alpha*-*-netbsd*)
@@ -299,7 +294,7 @@ i[34567]86-*-openbsd*)
;;
i[34567]86-*-coff*)
;;
-i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
+i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu*)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
;;
@@ -307,8 +302,6 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
;;
-i[34567]86-*-gnu*)
- ;;
i[34567]86-pc-msdosdjgpp*)
;;
i[34567]86-*-lynxos*)
@@ -576,7 +569,9 @@ m32c-*-elf*)
esac
case ${host} in
-i[34567]86-*-linux* | x86_64-*-linux*)
+i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
+ ;;
+i[34567]86-*-linux* | x86_64-*-linux* | i[34567]86-*-gnu*)
tmake_file="${tmake_file} t-tls"
;;
esac
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 1130bdf602c..8332fea3522 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,18 @@
+2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/37753
+ * io/transfer.c (unformatted_read): CONVERT_NATIVE
+ is the usual case. Check for kind==1 for non-byte-reversing
+ operation.
+ (unformatted_write): Likewise.
+
+2008-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37707
+ * io/list_read.c (nml_get_obj_data): If the first namelist object rank
+ is greater than zero, call nml_object_read with the first object rather
+ than the sub-object.
+
2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
Steve Ellcey <sje@cup.hp.com>
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index bcde3e1d49b..76634a3ee25 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2839,6 +2839,9 @@ get_name:
goto nml_err_ret;
}
+ if (first_nl != NULL && first_nl->var_rank > 0)
+ nl = first_nl;
+
if (nml_read_obj (dtp, nl, 0, pprev_nl, nml_err_msg, nml_err_msg_size,
clow, chigh) == FAILURE)
goto nml_err_ret;
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index cf93a286f98..acc7cbe9b94 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -738,8 +738,8 @@ unformatted_read (st_parameter_dt *dtp, bt type,
{
size_t i, sz;
- if (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE
- || size == 1)
+ if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE)
+ || kind == 1)
{
sz = size * nelems;
if (type == BT_CHARACTER)
@@ -789,8 +789,8 @@ static void
unformatted_write (st_parameter_dt *dtp, bt type,
void *source, int kind, size_t size, size_t nelems)
{
- if (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE ||
- size == 1)
+ if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE)
+ || kind == 1)
{
size_t stride = type == BT_CHARACTER ?
size * GFC_SIZE_OF_CHAR_KIND(kind) : size;
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index c79b3b75098..955e55003dd 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-08 David Edelsohn <edelsohn@gnu.org>
+
+ * xstrdup.c: Include <sys/types.h> after "config.h"
+
2008-10-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* configure.ac: Call AC_SYS_LARGEFILE.
diff --git a/libiberty/xstrdup.c b/libiberty/xstrdup.c
index 9ac2ea038f3..fa12c96a3cd 100644
--- a/libiberty/xstrdup.c
+++ b/libiberty/xstrdup.c
@@ -13,10 +13,10 @@ obtain memory.
*/
-#include <sys/types.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <sys/types.h>
#ifdef HAVE_STRING_H
#include <string.h>
#else
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index b09f9440d5f..9214759b304 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37568
+ * testsuite/libmudflap.c++/pass66-frag.cxx: New test.
+
2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
Steve Ellcey <sje@cup.hp.com>
diff --git a/libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx b/libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx
new file mode 100644
index 00000000000..989c7ca6f1c
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx
@@ -0,0 +1,17 @@
+// PR c++/37568
+// { dg-do compile }
+// { dg-options "-fmudflap -O" }
+
+struct A
+{
+ int i;
+};
+
+A
+foo ()
+{
+ A a = { 1 };
+ return a;
+}
+
+A a = foo ();
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 3b2762620f7..80c942ccad0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-08 Bob Walters <bob.s.walters@gmail.com>
+
+ * include/bits/stl_vector.h (_Vector_base<>::_Vector_impl::_M_start,
+ _M_finish, _M_end_of_storage, _Vector_base<>::_M_allocate,
+ _M_deallocate): Use _Tp_alloc_type::pointer.
+
2008-10-07 Jason Merrill <jason@redhat.com>
PR libstdc++/37761
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 28222f408f3..37bd21803d4 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -78,9 +78,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
struct _Vector_impl
: public _Tp_alloc_type
{
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
+ typename _Tp_alloc_type::pointer _M_start;
+ typename _Tp_alloc_type::pointer _M_finish;
+ typename _Tp_alloc_type::pointer _M_end_of_storage;
_Vector_impl()
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
@@ -140,12 +140,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
public:
_Vector_impl _M_impl;
- _Tp*
+ typename _Tp_alloc_type::pointer
_M_allocate(size_t __n)
{ return __n != 0 ? _M_impl.allocate(__n) : 0; }
void
- _M_deallocate(_Tp* __p, size_t __n)
+ _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n)
{
if (__p)
_M_impl.deallocate(__p, __n);