summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-17 04:40:08 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-17 04:40:08 +0000
commitd60c3572b2c5c73d0217066d3f4ebdae01663e53 (patch)
tree5157f3170a53eb9be6b856dcaeec31decab08ffe
parent1d6ddbbde651efdc85412db5e1e8b2d01501023c (diff)
downloadgcc-d60c3572b2c5c73d0217066d3f4ebdae01663e53.tar.gz
2008-04-17 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r134362 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@134378 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.melt2
-rw-r--r--gcc/ChangeLog174
-rw-r--r--gcc/ChangeLog.melt3
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in6
-rw-r--r--gcc/ada/ChangeLog67
-rw-r--r--gcc/ada/a-calcon.ads2
-rw-r--r--gcc/ada/a-calend-vms.adb2
-rw-r--r--gcc/ada/a-calend.adb2
-rw-r--r--gcc/ada/a-crdlli.ads4
-rw-r--r--gcc/ada/ada-tree.h8
-rw-r--r--gcc/ada/bcheck.adb2
-rw-r--r--gcc/ada/checks.adb2
-rw-r--r--gcc/ada/decl.c41
-rw-r--r--gcc/ada/einfo.ads10
-rw-r--r--gcc/ada/errout.adb4
-rw-r--r--gcc/ada/erroutc.adb2
-rw-r--r--gcc/ada/erroutc.ads2
-rw-r--r--gcc/ada/exp_attr.adb4
-rw-r--r--gcc/ada/exp_ch11.adb2
-rw-r--r--gcc/ada/exp_ch2.adb4
-rw-r--r--gcc/ada/exp_ch5.adb31
-rw-r--r--gcc/ada/exp_ch9.adb6
-rw-r--r--gcc/ada/exp_ch9.ads2
-rw-r--r--gcc/ada/exp_pakd.adb2
-rw-r--r--gcc/ada/exp_util.adb4
-rw-r--r--gcc/ada/fmap.adb2
-rw-r--r--gcc/ada/g-soccon-linux-mips.ads6
-rw-r--r--gcc/ada/g-soccon-rtems.ads4
-rw-r--r--gcc/ada/g-timsta.adb2
-rw-r--r--gcc/ada/g-timsta.ads2
-rw-r--r--gcc/ada/gen-soccon.c2
-rw-r--r--gcc/ada/gnat_rm.texi4
-rw-r--r--gcc/ada/lib-writ.ads6
-rw-r--r--gcc/ada/mlib-tgt-specific-linux.adb4
-rw-r--r--gcc/ada/mlib-tgt-specific-tru64.adb2
-rw-r--r--gcc/ada/s-interr-vxworks.adb2
-rw-r--r--gcc/ada/s-interr.adb2
-rw-r--r--gcc/ada/s-osinte-lynxos.ads2
-rw-r--r--gcc/ada/s-rident.ads2
-rw-r--r--gcc/ada/s-taprop-solaris.adb2
-rw-r--r--gcc/ada/s-tassta.adb2
-rw-r--r--gcc/ada/s-win32.ads2
-rw-r--r--gcc/ada/sem_aggr.adb2
-rw-r--r--gcc/ada/sem_attr.ads2
-rw-r--r--gcc/ada/sem_ch10.adb2
-rw-r--r--gcc/ada/sem_ch12.adb35
-rw-r--r--gcc/ada/sem_ch13.ads2
-rw-r--r--gcc/ada/sem_ch3.adb6
-rw-r--r--gcc/ada/sem_ch6.adb2
-rw-r--r--gcc/ada/sem_ch7.adb4
-rw-r--r--gcc/ada/sem_ch8.adb16
-rw-r--r--gcc/ada/sem_ch9.adb2
-rw-r--r--gcc/ada/sem_prag.adb6
-rw-r--r--gcc/ada/sem_prag.ads2
-rw-r--r--gcc/ada/sem_res.adb2
-rw-r--r--gcc/ada/sem_util.adb2
-rw-r--r--gcc/ada/sem_util.ads2
-rw-r--r--gcc/ada/sinfo.ads2
-rw-r--r--gcc/ada/trans.c5
-rw-r--r--gcc/ada/utils2.c37
-rw-r--r--gcc/ada/vms_data.ads2
-rw-r--r--gcc/c-common.c3
-rw-r--r--gcc/c-decl.c5
-rw-r--r--gcc/c-pretty-print.c4
-rw-r--r--gcc/calls.c1
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/bfin/constraints.md225
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/config/i386/i386.md40
-rw-r--r--gcc/config/i386/winnt.c9
-rw-r--r--gcc/config/ia64/ia64.c3
-rw-r--r--gcc/config/ia64/ia64.md47
-rw-r--r--gcc/cp/ChangeLog30
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/cp/optimize.c1
-rw-r--r--gcc/doc/invoke.texi19
-rw-r--r--gcc/dwarf2asm.c3
-rw-r--r--gcc/dwarf2out.c3
-rw-r--r--gcc/except.c253
-rw-r--r--gcc/except.h5
-rw-r--r--gcc/expr.c4
-rw-r--r--gcc/final.c9
-rw-r--r--gcc/flags.h3
-rw-r--r--gcc/fold-const.c22
-rw-r--r--gcc/fortran/ChangeLog13
-rw-r--r--gcc/fortran/expr.c11
-rw-r--r--gcc/fortran/f95-lang.c6
-rw-r--r--gcc/function.h31
-rw-r--r--gcc/gengtype.c2
-rw-r--r--gcc/libgcc2.c4
-rw-r--r--gcc/params.def2
-rw-r--r--gcc/print-rtl.c2
-rw-r--r--gcc/print-tree.c6
-rw-r--r--gcc/sched-vis.c3
-rw-r--r--gcc/testsuite/ChangeLog125
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr35751.C34
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-overflow-22.c13
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pr35739.c16
-rw-r--r--gcc/testsuite/gcc.dg/fold-compare-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr35751.c34
-rw-r--r--gcc/testsuite/gcc.dg/no-strict-overflow-7.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr35899.c15
-rw-r--r--gcc/testsuite/gcc.dg/strict-overflow-6.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/alias-15.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-25.c11
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-35.c64
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21086.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr26421.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/salias-1.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c2
-rw-r--r--gcc/testsuite/gfortran.dg/pr35662.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/pr35944-1.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/pr35944-2.f9015
-rw-r--r--gcc/testsuite/gnat.dg/incomplete1.ads3
-rw-r--r--gcc/testsuite/gnat.dg/incomplete2.adb4
-rw-r--r--gcc/testsuite/gnat.dg/incomplete2.ads8
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization1.adb27
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization1.ads35
-rw-r--r--gcc/testsuite/gnat.dg/prot_def.adb44
-rw-r--r--gcc/testsuite/gnat.dg/specs/corr_discr.ads13
-rw-r--r--gcc/testsuite/gnat.dg/specs/linker_section.ads5
-rw-r--r--gcc/testsuite/gnat.dg/specs/storage.ads2
-rw-r--r--gcc/testsuite/gnat.dg/string_slice2.adb24
-rw-r--r--gcc/tree-affine.c39
-rw-r--r--gcc/tree-inline.c6
-rw-r--r--gcc/tree-nrv.c7
-rw-r--r--gcc/tree-predcom.c3
-rw-r--r--gcc/tree-pretty-print.c3
-rw-r--r--gcc/tree-ssa-propagate.c36
-rw-r--r--gcc/tree-ssa-sccvn.c7
-rw-r--r--gcc/tree-ssa-sccvn.h2
-rw-r--r--gcc/tree-ssa-structalias.c15
-rw-r--r--gcc/tree-vn.c6
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/intrinsics/spread_generic.c2
-rw-r--r--libjava/ChangeLog9
-rw-r--r--libjava/libgcj_bc.c46
-rw-r--r--libstdc++-v3/ChangeLog11
-rw-r--r--libstdc++-v3/acinclude.m44
-rwxr-xr-xlibstdc++-v3/configure6
-rw-r--r--libstdc++-v3/include/bits/c++config3
142 files changed, 1657 insertions, 504 deletions
diff --git a/ChangeLog.melt b/ChangeLog.melt
index d7182955daa..8fd8569c647 100644
--- a/ChangeLog.melt
+++ b/ChangeLog.melt
@@ -1,3 +1,5 @@
+2008-04-17 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk r134362
2008-04-14 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r134275
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b15e712aea4..57d334c17e0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,161 @@
+2008-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35739
+ * tree-nrv.c (tree_nrv): Don't optimize if result_type is GIMPLE
+ reg type.
+
+ PR tree-optimization/35899
+ * tree-inline.c (expand_call_inline): Use GIMPLE_STMT_OPERAND
+ rather than TREE_OPERAND.
+
+2008-04-16 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/35944
+ * config/i386/i386.md (fmodxf3): Copy operand 1 and operand 2 into
+ temporary registers. Change operand predicate to general_operand.
+ (remainderxf3): Ditto.
+
+2008-04-16 Richard Guenther <rguenther@suse.de>
+
+ * Makefile.in (tree-affine.o): Add $(FLAGS_H) dependency.
+ * tree-affine.c (aff_combination_expand): Look through some
+ conversions.
+
+2008-04-15 Doug Kwan <dougkwan@google.com>
+
+ * dwarf2asm.c (dw2_assemble_integer): Cast to unsigned HOST_WIDE_INT
+ for hex printing.
+ * tree-pretty-print.c (dump_generic_node): Ditto.
+ * final.c (output_addr_const): Ditto.
+ * dwarf2out.c (output_cfi): Ditto.
+ * c-pretty-print.c (pp_c_integer_constant): Ditto.
+ * print-rtl.c (print_rtx): Ditto.
+ * print-tree.c (print_node_brief, print_node): Ditto.
+ * c-common.c (match_case_to_enum_1): Ditto.
+ * sched-vis.c (print_value): Ditto.
+ * config/i386/i386.c (print_operand): Cast to long unsigned int
+ for hex printing.
+
+2008-04-15 Danny Smith <dannysmith@users.sourceforge.net>
+ * libgcc2.c [L_trampoline]: Remove unnecessary prototype for
+ MS Windows VirtualProtect function.
+
+2008-04-15 Jan Hubicka <jh@suse.cz>
+
+ * gengtype.c (write_root): Param_is argument is OK.
+ * expr.c (expand_expr_real_1): Update call of get_exception_*.
+ * function.h: Include varray.h
+ (rtl_eh): New stucture based on except.c one.
+ (call_site_record): New forward declaration and vector type.
+ * calls.c (emit_call_1): Do not call
+ note_current_region_may_contain_throw.
+ * except.c (eh_status): Remove cur_region, try_region since they are
+ unused.
+ Move filter, exc_ptr, ttype_data, ehspec_data, action_record_data and
+ exception_handler_label_map, ehr_stackadj, ehr_handler, ehr_label,
+ sjlj_fc, sjlj_exit_after to rth_eh in function.h.
+ Remove call_site_data_used, call_site_data_size.
+ Turn call_site_record into vector in function.h.
+ (note_current_region_may_contain_throw): Remove.
+ (get_exception_pointer, get_exception_filter): Do not take struct
+ function argument; update.
+ (add_ehl_entry, find_exception_handler_labels, ehspec_filter_hash,
+ add_ttypes_entry, add_ehspec_entry, assign_filter_values,
+ build_post_landing_pads, dw2_build_landing_pads,
+ sjlj_assign_call_site_values, sjlj_mark_call_sites,
+ sjlj_emit_function_enter, sjlj_emit_function_enter,
+ sjlj_emit_function_exit, sjlj_emit_dispatch_table,
+ sjlj_build_landing_pads, finish_eh_generation,
+ remove_exception_handler_label, remove_eh_handler,
+ maybe_remove_eh_handler, add_reachable_handler,
+ reachable_handlers, expand_builtin_eh_return, expand_eh_return,
+ add_action_record, collect_one_action_chain, add_call_site,
+ convert_to_eh_region_ranges, sjlj_size_of_call_site_table,
+ sjlj_output_call_site_table, output_function_exception_table,
+ * except.h (note_current_region_may_contain_throw): Remove
+ (get_exception_pointer, get_exception_filter): Do not take struct
+ function argument.
+ * Makefile.in (GTFILES): Put varargs before struct function.
+
+2008-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-structalias.c (get_constraint_for_component_ref): Do not
+ punt for STRING_CST.
+ (get_constraint_for): Deal with STRING_CST here instead.
+
+2008-04-15 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-propagate.c (substitute_and_fold): Substitute
+ statements in a basic-block with a backward walk. Do not
+ substitute into dead statements but instead remove those.
+
+2008-04-15 Richard Guenther <rguenther@suse.de>
+
+ * params.def (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE): Set default
+ to zero, thus disable creation of SFTs.
+
+2008-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-predcom.c (suitable_reference_p): Return false if the
+ reference can throw.
+
+2008-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35751
+ * c-decl.c (finish_decl): If extern or static var has variable
+ size, set TREE_TYPE (decl) to error_mark_node.
+
+2008-04-15 Rafael Espindola <espindola@google.com>
+
+ * fold-const.c (tree_call_nonnegative_warnv_p): Remove local
+ variable arg1.
+
+2008-04-15 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-sccvn.h (vn_reference_lookup): Adjust prototype.
+ * tree-ssa-sccvn.c (vn_reference_lookup): New parameter maywalk.
+ (visit_reference_op_load): Do walk vuse-vdef chains on
+ vn_reference_lookup.
+ (visit_reference_op_store): But do not here.
+ * tree-vn.c (vn_lookup): Do not walk vuse-vdef chains on
+ vn_reference_lookup.
+ (vn_lookup_with_vuses): But do so here.
+
+2008-04-14 Ian Lance Taylor <iant@google.com>
+
+ * fold-const.c (fold_overflow_warning): Remove assertion.
+
+2008-04-15 Ben Elliston <bje@au.ibm.com>
+
+ * config/alpha/alpha.c (alpha_initialize_trampoline): Remove temp,
+ temp1 local variables.
+
+2008-04-15 Zuxy Meng <zuxy.meng@gmail.com>
+
+ PR target/35661
+ * config/i386/winnt.c (i386_pe_section_type_flags): Mark
+ ".text.unlikely" section as executable.
+
+2008-04-14 James E. Wilson <wilson@tuliptree.org>
+
+ * config/ia64/ia64.c (rtx_needs_barrier): Handle
+ UNSPEC_FR_SQRT_RECIP_APPROX_RES.
+ * config/ia64/ia64.c (UNSPEC_FR_SQRT_RECIP_APPROX_RES): Define.
+ (divsi3_internal, divdi3_internal_lat, divdi3_internal_thr,
+ divsf3_internal_lat, sqrt_approx, sqrtsf2_internal_thr,
+ divdf3_internal_lat, sqrtdf2_internal_thr, divxf3_internal_lat,
+ divxf3_internal_thr, sqrtxf2_internal_thr, recip_approx): Use it.
+
+2008-04-14 Ian Lance Taylor <iant@google.com>
+
+ * flags.h (POINTER_TYPE_OVERFLOW_UNDEFINED): Define.
+ * fold-const.c (fold_comparison): If appropriate, test
+ POINTER_TYPE_OVERFLOW_UNDEFINED, and issue an overflow warning.
+ (fold_binary): Test POINTER_TYPE_OVERFLOW_UNDEFINED when
+ reassociating a pointer type.
+ * doc/invoke.texi (Optimize Options): Document that
+ -fstrict-overflow applies to pointer wraparound.
+
2008-04-13 Jan Hubicka <jh@suse.cz>
* m32.c (m32c_pushm_popm): Use crtl->retrun_rtx.
@@ -89,7 +247,7 @@
2008-04-10 Rafael Espindola <espindola@google.com>
- * gcc/tree-vrp.c (extract_range_from_binary_expr): Don't handle
+ * tree-vrp.c (extract_range_from_binary_expr): Don't handle
TRUTH_ANDIF_EXPR or TRUTH_ORIF_EXPR.
(extract_range_from_expr): The same.
@@ -1006,9 +1164,9 @@
2008-04-02 Kai Tietz <kai.tietz@onevision.com>
* config.gcc: Add for x86_64-*-mingw* the t-crtfm to tbuild.
- * gcc/config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Add 8 byte
+ * config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Add 8 byte
offsets for 64-bit mingw.
- * gcc/config/i386/i386.c (ix86_pass_by_reference): Correct calling
+ * config/i386/i386.c (ix86_pass_by_reference): Correct calling
abi for x86_64-pc-mingw.
2008-04-02 Richard Guenther <rguenther@suse.de>
@@ -2398,7 +2556,7 @@
2008-03-15 Bjoern Haase <bjoern.m.haase@web.de>
Anatoly Sokolov <aesok@post.ru>
- * gcc/gcc/config/avr/avr.c (avr_arch_types): Add avr6 entry.
+ * config/avr/avr.c (avr_arch_types): Add avr6 entry.
(avr_arch): Add ARCH_AVR6.
(avr_mcu_types): Add 'atmega2560' and 'atmega2561' entry.
(initial_elimination_offset): Initialize and use 'avr_pc_size'
@@ -2407,7 +2565,7 @@
(avr_assemble_integer): (Ditto.).
(avr_output_addr_vec_elt): (Ditto.).
(print_operand): Handle "!" code.
- * gcc/gcc/config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Add
+ * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Add
__AVR_3_BYTE_PC__, __AVR_2_BYTE_PC__ and __AVR_HAVE_JMP_CALL__.
(AVR_HAVE_EIJMP_EICALL): Define.
(AVR_3_BYTE_PC): Redefine.
@@ -2416,7 +2574,7 @@
(LINK_SPEC): Add atmega2560 and atmega2561.
(CRT_BINUTILS_SPEC): Add atmega2560 (crtm2560.o) and atmega2561
(crtm2561.o).
- * gcc/gcc/config/avr/avr.md (call_insn): Use eicall instead of icall
+ * config/avr/avr.md (call_insn): Use eicall instead of icall
for 3 byte PC devices.
(call_value_insn): (Ditto.).
(*tablejump_enh): Use eijmp instead of ijmp for 3 byte PC devices.
@@ -2424,10 +2582,10 @@
(*tablejump): (Ditto.).
(*indirect_jump_avr6): Add insn.
(*tablejump_rjmp): Don't use for 3 byte PC devices.
- * gcc/gcc/config/avr/libgcc.S (__prologue_saves__): Use eijmp
+ * config/avr/libgcc.S (__prologue_saves__): Use eijmp
instead of ijmp for 3 byte PC devices.
(__tablejump2__): (Ditto.).
- * gcc/gcc/config/avr/t-avr (MULITLIB_OPTIONS): Add avr6 architecture.
+ * config/avr/t-avr (MULITLIB_OPTIONS): Add avr6 architecture.
(MULITLIB_DIRNAMES): (Ditto.).
(MULTILIB_MATCHES): Add atmega2560 and atmega2561 to list.
diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt
index 37afed6460f..19b5289e400 100644
--- a/gcc/ChangeLog.melt
+++ b/gcc/ChangeLog.melt
@@ -1,3 +1,6 @@
+2008-04-17 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk r134362
+
2008-04-16 Basile Starynkevitch <basile@starynkevitch.net>
* basilys.c: (basilys_caught_assign_at) added msg 4th argument
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 9ce44af4554..acc628dee63 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080414
+20080416
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index befd2577be6..320953257a9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2225,7 +2225,7 @@ tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-chrec.h $(VARRAY_H) tree-affine.h pointer-set.h $(TARGET_H)
tree-affine.o : tree-affine.c tree-affine.h $(CONFIG_H) pointer-set.h \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(TREE_GIMPLE_H) \
- output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H)
+ output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(FLAGS_H)
tree-ssa-loop-manip.o : tree-ssa-loop-manip.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \
output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
@@ -3165,8 +3165,8 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(host_xm_file_list) \
$(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
$(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \
- $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \
- $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
+ $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/varray.h $(srcdir)/libfuncs.h $(SYMTAB_H) \
+ $(srcdir)/real.h $(srcdir)/function.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
$(srcdir)/fixed-value.h \
$(srcdir)/ipa-reference.h $(srcdir)/output.h $(srcdir)/cfgloop.h \
$(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 199fe294a83..346866e9215 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,70 @@
+2008-04-16 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/29015
+ * sem_ch12.adb (Instantiate_Type): Check whether the full view of
+ the type is known instead of the underlying type.
+
+2008-04-15 Ed Schonberg <schonberg@adacore.com>
+
+ PR ada/22387
+ * exp_ch5.adb (Expand_Assign_Record): Within an initialization
+ procedure for a derived type retrieve the discriminant values from
+ the parent using the corresponding discriminant.
+
+2008-04-15 Samuel Tardieu <sam@rfc1149.net>
+ Gary Dismukes <dismukes@adacore.com>
+
+ PR ada/28733
+ * sem_ch8.adb (Analyze_Use_Package): Do not allow "use" of something
+ which is not an entity (and hence not a package).
+ (End_Use_Package): Ditto.
+
+2008-04-15 Ed Schonberg <schonberg@adacore.com>
+
+ PR ada/16086
+ * sem_ch12.adb (Analyze_Formal_Subprogram): The default can be any
+ protected operation that matches the signature, not only an entry, a
+ regular subprogram or a literal.
+
+2008-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ada-tree.h (DECL_BY_COMPONENT_PTR_P): Use DECL_LANG_FLAG_3.
+ * decl.c (gnat_to_gnu_entity) <object>: Call maybe_pad_type only
+ if a size or alignment is specified. Do not take into account
+ alignment promotions for the computation of the object's size.
+ <type>: Call maybe_pad_type only if a size or alignment is specified.
+ (maybe_pad_type): Really reuse the RM_Size of the original type if
+ requested.
+ * trans.c (Attribute_to_gnu): Fix a couple of nits.
+ * utils2.c (build_binary_op) <MODIFY_EXPR>: Merge related conditional
+ statements. Use the padded view of the type when copying between
+ padded objects of the same underlying type.
+
+2008-04-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * vms_data.ads: Fix typo in constant.
+ * gen-soccon.c: Fix typo in error string.
+ * gnat_rm.texi (Pragma Optimize_Alignment, Pragma Postcondition):
+ Fix typos.
+ * a-calcon.ads, a-calend-vms.adb, a-calend.adb, a-crdlli.ads,
+ bcheck.adb, checks.adb, einfo.ads, errout.adb, erroutc.adb,
+ erroutc.ads, exp_attr.adb, exp_ch11.adb, exp_ch2.adb,
+ exp_ch5.adb, exp_ch9.adb, exp_ch9.ads, exp_pakd.adb,
+ exp_util.adb, fmap.adb, g-soccon-linux-mips.ads,
+ g-soccon-rtems.ads, g-timsta.adb, g-timsta.ads, lib-writ.ads,
+ mlib-tgt-specific-linux.adb, mlib-tgt-specific-tru64.adb,
+ s-interr-vxworks.adb, s-interr.adb, s-osinte-lynxos.ads,
+ s-rident.ads, s-taprop-solaris.adb, s-tassta.adb, s-win32.ads,
+ sem_aggr.adb, sem_attr.ads, sem_ch10.adb, sem_ch13.ads,
+ sem_ch3.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_ch9.adb,
+ sem_prag.ads, sem_res.adb, sem_util.adb, sem_util.ads,
+ sinfo.ads: Fix typos in comments.
+
+2008-04-14 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, Linker_Section case): Extend error
+ to every non-object and change error message.
+
2008-04-14 Robert Dewar <dewar@adacore.com>
* sem_util.ads, sem_util.adb (In_Subprogram): Remove.
diff --git a/gcc/ada/a-calcon.ads b/gcc/ada/a-calcon.ads
index d2dd3fbcc10..c0178a092a6 100644
--- a/gcc/ada/a-calcon.ads
+++ b/gcc/ada/a-calcon.ads
@@ -68,7 +68,7 @@ package Ada.Calendar.Conversions is
-- The returned value is in UTC and may or may not contain leap seconds
-- depending on whether binder flag "-y" was used. Raises Time_Error if
-- the input values are out of the defined ranges or if tm_sec equals 60
- -- and the instance in time is not a leap second occurence.
+ -- and the instance in time is not a leap second occurrence.
function To_Duration
(tv_sec : Interfaces.C.long;
diff --git a/gcc/ada/a-calend-vms.adb b/gcc/ada/a-calend-vms.adb
index 86e77cb66a6..6cbc7288d23 100644
--- a/gcc/ada/a-calend-vms.adb
+++ b/gcc/ada/a-calend-vms.adb
@@ -920,7 +920,7 @@ package body Ada.Calendar is
tm_year := Year - 1900;
tm_mon := Month - 1;
- -- Step 3: Handle leap second occurences
+ -- Step 3: Handle leap second occurrences
if Leap_Sec then
tm_sec := 60;
diff --git a/gcc/ada/a-calend.adb b/gcc/ada/a-calend.adb
index 2e7c61a9d7f..d543cd85939 100644
--- a/gcc/ada/a-calend.adb
+++ b/gcc/ada/a-calend.adb
@@ -939,7 +939,7 @@ package body Ada.Calendar is
tm_year := Year - 1900;
tm_mon := Month - 1;
- -- Step 3: Handle leap second occurences
+ -- Step 3: Handle leap second occurrences
if Leap_Sec then
tm_sec := 60;
diff --git a/gcc/ada/a-crdlli.ads b/gcc/ada/a-crdlli.ads
index a97f354d43e..ca78cb526b9 100644
--- a/gcc/ada/a-crdlli.ads
+++ b/gcc/ada/a-crdlli.ads
@@ -253,7 +253,7 @@ package Ada.Containers.Restricted_Doubly_Linked_Lists is
Position : Cursor := No_Element) return Cursor;
-- Searches for the node whose element is equal to Item, starting from
-- Position and continuing to the last end of the list. If Position equals
- -- No_Element, the seach starts from the first node. If Position is
+ -- No_Element, the search starts from the first node. If Position is
-- associated with a list object different from Container, then
-- Program_Error is raised. If no node is found having an element equal to
-- Item, then Find returns No_Element.
@@ -264,7 +264,7 @@ package Ada.Containers.Restricted_Doubly_Linked_Lists is
Position : Cursor := No_Element) return Cursor;
-- Searches in reverse for the node whose element is equal to Item,
-- starting from Position and continuing to the first end of the list. If
- -- Position equals No_Element, the seach starts from the last node. If
+ -- Position equals No_Element, the search starts from the last node. If
-- Position is associated with a list object different from Container, then
-- Program_Error is raised. If no node is found having an element equal to
-- Item, then Reverse_Find returns No_Element.
diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h
index b38c34da573..6c60adfbfa4 100644
--- a/gcc/ada/ada-tree.h
+++ b/gcc/ada/ada-tree.h
@@ -243,13 +243,13 @@ struct lang_type GTY(()) {tree t; };
is needed to access the object. */
#define DECL_BY_REF_P(NODE) DECL_LANG_FLAG_1 (NODE)
-/* Nonzero if this decl is a PARM_DECL for an Ada array being passed to a
- foreign convention subprogram. */
-#define DECL_BY_COMPONENT_PTR_P(NODE) DECL_LANG_FLAG_2 (PARM_DECL_CHECK (NODE))
-
/* Nonzero in a FIELD_DECL that is a dummy built for some internal reason. */
#define DECL_INTERNAL_P(NODE) DECL_LANG_FLAG_3 (FIELD_DECL_CHECK (NODE))
+/* Nonzero if this decl is a PARM_DECL for an Ada array being passed to a
+ foreign convention subprogram. */
+#define DECL_BY_COMPONENT_PTR_P(NODE) DECL_LANG_FLAG_3 (PARM_DECL_CHECK (NODE))
+
/* Nonzero in a FUNCTION_DECL that corresponds to an elaboration procedure. */
#define DECL_ELABORATION_PROC_P(NODE) \
DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (NODE))
diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb
index 3332d2083f8..a1edd067979 100644
--- a/gcc/ada/bcheck.adb
+++ b/gcc/ada/bcheck.adb
@@ -703,7 +703,7 @@ package body Bcheck is
-----------------------------------------
-- The rule is that all units which depend on the global default setting
- -- of Optimize_Alignment must be compiled with the same settinng for this
+ -- of Optimize_Alignment must be compiled with the same setting for this
-- default. Units which specify an explicit local value for this setting
-- are exempt from the consistency rule (this includes all internal units).
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 1dfd0de9914..38512547e7f 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -2769,7 +2769,7 @@ package body Checks is
-- Check that a null-excluding component, formal or object is not being
-- assigned a null value. Otherwise generate a warning message and
- -- replace Expression (N) by an N_Contraint_Error node.
+ -- replace Expression (N) by an N_Constraint_Error node.
if K /= N_Function_Specification then
Expr := Expression (N);
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index eabc9211e19..2b2ec684668 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -516,6 +516,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
bool mutable_p = false;
tree gnu_ext_name = NULL_TREE;
tree renamed_obj = NULL_TREE;
+ tree gnu_object_size;
if (Present (Renamed_Object (gnat_entity)) && !definition)
{
@@ -771,9 +772,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
align = MINIMUM_ATOMIC_ALIGNMENT;
#endif
- /* Make a new type with the desired size and alignment, if needed. */
- gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
- "PAD", false, definition, true);
+ /* Make a new type with the desired size and alignment, if needed.
+ But do not take into account alignment promotions to compute the
+ size of the object. */
+ gnu_object_size = gnu_size ? gnu_size : TYPE_SIZE (gnu_type);
+ if (gnu_size || align > 0)
+ gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
+ "PAD", false, definition,
+ gnu_size ? true : false);
/* Make a volatile version of this object's type if we are to make
the object volatile. We also interpret 13.3(19) conservatively
@@ -1290,16 +1296,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (!used_by_ref && Unknown_Esize (gnat_entity))
{
- tree gnu_back_size;
-
if (TREE_CODE (gnu_type) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (gnu_type))
- gnu_back_size
+ gnu_object_size
= TYPE_SIZE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type))));
- else
- gnu_back_size = TYPE_SIZE (gnu_type);
- Set_Esize (gnat_entity, annotate_value (gnu_back_size));
+ Set_Esize (gnat_entity, annotate_value (gnu_object_size));
}
}
break;
@@ -4237,8 +4239,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* See if we need to pad the type. If we did, and made a record,
the name of the new type may be changed. So get it back for
us when we make the new TYPE_DECL below. */
- gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity, "PAD",
- true, definition, false);
+ if (gnu_size || align > 0)
+ gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
+ "PAD", true, definition, false);
+
if (TREE_CODE (gnu_type) == RECORD_TYPE
&& TYPE_IS_PADDING_P (gnu_type))
{
@@ -5562,19 +5566,18 @@ make_packable_type (tree type, bool in_record)
DEFINITION is true if this type is being defined.
- SAME_RM_SIZE is true if the RM_Size of the resulting type is to be
- set to its TYPE_SIZE; otherwise, it's set to the RM_Size of the original
- type. */
+ SAME_RM_SIZE is true if the RM_Size of the resulting type is to be set
+ to SIZE too; otherwise, it's set to the RM_Size of the original type. */
tree
maybe_pad_type (tree type, tree size, unsigned int align,
Entity_Id gnat_entity, const char *name_trailer,
bool is_user_type, bool definition, bool same_rm_size)
{
+ tree orig_rm_size = same_rm_size ? NULL_TREE : rm_size (type);
tree orig_size = TYPE_SIZE (type);
unsigned int orig_align = align;
- tree record;
- tree field;
+ tree record, field;
/* If TYPE is a padded type, see if it agrees with any size and alignment
we were given. If so, return the original type. Otherwise, strip
@@ -5673,9 +5676,9 @@ maybe_pad_type (tree type, tree size, unsigned int align,
/* Do not finalize it until after the auxiliary record is built. */
finish_record_type (record, field, 1, true);
- /* Keep the RM_Size of the padded record as that of the old record
- if requested. */
- SET_TYPE_ADA_SIZE (record, same_rm_size ? size : rm_size (type));
+ /* Set the same size for its RM_size if requested; otherwise reuse
+ the RM_size of the original type. */
+ SET_TYPE_ADA_SIZE (record, same_rm_size ? size : orig_rm_size);
/* Unless debugging information isn't being written for the input type,
write a record that shows what we are a subtype of and also make a
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 10d7deb7aa1..852d9966ddf 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -457,7 +457,7 @@ package Einfo is
-- for finalization purposes, The block entity has an implicit label
-- declaration in the enclosing declarative part, and has otherwise
-- no direct connection in the tree with the block statement. The
--- link is to the identifier (which is an occurence of the entity)
+-- link is to the identifier (which is an occurrence of the entity)
-- and not to the block_statement itself, because the statement may
-- be rewritten, e.g. in the process of removing dead code.
@@ -559,7 +559,7 @@ package Einfo is
-- component clause applies to the component. First bit position of
-- given component, computed from the first bit and position values
-- given in the component clause. A value of No_Uint means that the
--- value is not yet known. The value can be set by the appearence of
+-- value is not yet known. The value can be set by the appearance of
-- an explicit component clause in a record representation clause,
-- or it can be set by the front-end in package Layout, or it can be
-- set by the backend. By the time backend processing is completed,
@@ -873,7 +873,7 @@ package Einfo is
-- Elaboration_Entity (Node13)
-- Present in generic and non-generic package and subprogram
-- entities. This is a boolean entity associated with the unit that
--- is initiallly set to False, and is set True when the unit is
+-- is initially set to False, and is set True when the unit is
-- elaborated. This is used for two purposes. First, it is used to
-- implement required access before elaboration checks (the flag
-- must be true to call a subprogram at elaboration time). Second,
@@ -3534,7 +3534,7 @@ package Einfo is
-- Present in subprogram entities. Points to a list of Precondition
-- and Postcondition N_Pragma nodes for preconditions and postconditions
-- declared in the spec. The last pragma encountered is at the head of
--- this list, so it is in reverse order of textual appearence.
+-- this list, so it is in reverse order of textual appearance.
-- Storage_Size_Variable (Node15) [implementation base type only]
-- Present in access types and task type entities. This flag is set
@@ -5645,7 +5645,7 @@ package Einfo is
-- required discriminant values. The expander creates a set of declarations
-- of the form:
- -- discr_nameD : constant disrc_type renames _task.discr_name;
+ -- discr_nameD : constant discr_type renames _task.discr_name;
-- where discr_nameD is the discriminal entity referenced by the task
-- discriminant, and _task is the task value passed in as the parameter.
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index d898a306d67..8d1a2c14573 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -191,8 +191,8 @@ package body Errout is
procedure VMS_Convert;
-- This procedure has no effect if called when the host is not OpenVMS.
-- If the host is indeed OpenVMS, then the error message stored in
- -- Msg_Buffer is scanned for appearences of switch names which need
- -- converting to corresponding VMS qualifer names. See Gnames/Vnames
+ -- Msg_Buffer is scanned for appearances of switch names which need
+ -- converting to corresponding VMS qualifier names. See Gnames/Vnames
-- table in Errout spec for precise definition of the conversion that
-- is performed by this routine in OpenVMS mode.
diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
index 604fd5409e3..f255ac00e9e 100644
--- a/gcc/ada/erroutc.adb
+++ b/gcc/ada/erroutc.adb
@@ -504,7 +504,7 @@ package body Erroutc is
else
Start := Ptr;
- -- First scan forward looing for a hard end of line
+ -- First scan forward looking for a hard end of line
for Scan in Ptr .. Ptr + Max - 1 loop
if Txt (Scan) = ASCII.LF then
diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads
index edc1140fbef..ba212eeb42b 100644
--- a/gcc/ada/erroutc.ads
+++ b/gcc/ada/erroutc.ads
@@ -52,7 +52,7 @@ package Erroutc is
Is_Style_Msg : Boolean := False;
-- Set True to indicate if the current message is a style message
- -- (i.e. a message whose text starts with the cahracters "(style)").
+ -- (i.e. a message whose text starts with the characters "(style)").
Is_Serious_Error : Boolean := False;
-- Set by Set_Msg_Text to indicate if current message is serious error
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index b6d4ae8d6e3..1637863cf45 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -2212,7 +2212,7 @@ package body Exp_Attr is
-- sourcetyp (streamread (strmtyp'Input (stream)));
- -- where stmrearead is the given Read function that converts an
+ -- where streamread is the given Read function that converts an
-- argument of type strmtyp to type sourcetyp or a type from which
-- it is derived (extra conversion required for the derived case).
@@ -2810,7 +2810,7 @@ package body Exp_Attr is
-- result is modulus + value, where the value might be as small as
-- -modulus. The trouble is what type do we use to do the subtract.
-- No type will do, since modulus can be as big as 2**64, and no
- -- integer type accomodates this value. Let's do bit of algebra
+ -- integer type accommodates this value. Let's do bit of algebra
-- modulus + value
-- = modulus - (-value)
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index ac3590179e4..2cfde4df912 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -849,7 +849,7 @@ package body Exp_Ch11 is
begin
-- If we have no Entity, then we are probably in no run time mode
- -- or some weird error has occured. In either case do do nothing!
+ -- or some weird error has occurred. In either case do do nothing!
if Present (Ent) then
declare
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb
index 82ac5eea7f4..c3716c387fa 100644
--- a/gcc/ada/exp_ch2.adb
+++ b/gcc/ada/exp_ch2.adb
@@ -184,7 +184,7 @@ package body Exp_Ch2 is
end if;
-- If constant value is an occurrence of an enumeration literal,
- -- then we just make another occurence of the same literal.
+ -- then we just make another occurrence of the same literal.
if Is_Entity_Name (Val)
and then Ekind (Entity (Val)) = E_Enumeration_Literal
@@ -469,7 +469,7 @@ package body Exp_Ch2 is
-- we also generate an extra parameter to hold the Constrained
-- attribute of the actual. No renaming is generated for this flag.
- -- Calling Node_Posssible_Modifications in the expander is dubious,
+ -- Calling Node_Possible_Modifications in the expander is dubious,
-- because this generates a cross-reference entry, and should be
-- done during semantic processing so it is called in -gnatc mode???
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 68965c71493..0018a673522 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1345,13 +1345,30 @@ package body Exp_Ch5 is
F := First_Discriminant (R_Typ);
while Present (F) loop
- if Is_Unchecked_Union (Base_Type (R_Typ)) then
- Insert_Action (N, Make_Field_Assign (F, True));
- else
- Insert_Action (N, Make_Field_Assign (F));
- end if;
+ -- If we are expanding the initialization of a derived record
+ -- that constrains or renames discriminants of the parent, we
+ -- must use the corresponding discriminant in the parent.
+
+ declare
+ CF : Entity_Id;
- Next_Discriminant (F);
+ begin
+ if Inside_Init_Proc
+ and then Present (Corresponding_Discriminant (F))
+ then
+ CF := Corresponding_Discriminant (F);
+ else
+ CF := F;
+ end if;
+
+ if Is_Unchecked_Union (Base_Type (R_Typ)) then
+ Insert_Action (N, Make_Field_Assign (CF, True));
+ else
+ Insert_Action (N, Make_Field_Assign (CF));
+ end if;
+
+ Next_Discriminant (F);
+ end;
end loop;
end if;
@@ -3467,7 +3484,7 @@ package body Exp_Ch5 is
procedure Expand_N_Simple_Return_Statement (N : Node_Id) is
begin
- -- Defend agains previous errors (ie. the return statement calls a
+ -- Defend against previous errors (i.e. the return statement calls a
-- function that is not available in configurable runtime).
if Present (Expression (N))
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index b999bfaa6c4..ca4d70b2c02 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -195,7 +195,7 @@ package body Exp_Ch9 is
(Loc : Source_Ptr;
Def_Id : Entity_Id;
Ent_Id : Entity_Id) return Node_Id;
- -- Build a specification for the procedure implementing the statemens of
+ -- Build a specification for the procedure implementing the statements of
-- the specified entry body. Add attributes associating it with the entry
-- defining identifier Ent_Id.
@@ -2027,7 +2027,7 @@ package body Exp_Ch9 is
Add_Object_Pointer (Loc, Pid, Op_Decls);
-- Add renamings for all formals, the Protection object, discriminals,
- -- privals and the entry indix constant for use by debugger.
+ -- privals and the entry index constant for use by debugger.
Add_Formal_Renamings (Espec, Op_Decls, Ent, Loc);
Debug_Private_Data_Declarations (Decls);
@@ -3429,7 +3429,7 @@ package body Exp_Ch9 is
begin
-- Add renamings for the Protection object, discriminals, privals and
- -- the entry indix constant for use by debugger.
+ -- the entry index constant for use by debugger.
Debug_Private_Data_Declarations (Decls);
diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads
index 71c1e830c3c..2628e150ca1 100644
--- a/gcc/ada/exp_ch9.ads
+++ b/gcc/ada/exp_ch9.ads
@@ -321,7 +321,7 @@ package Exp_Ch9 is
procedure Set_Discriminals (Dec : Node_Id);
-- Replace discriminals in a protected type for use by the next protected
- -- operation on the type. Each operation needs a new set of discirminals,
+ -- operation on the type. Each operation needs a new set of discriminals,
-- since it needs a unique renaming of the discriminant fields in the
-- record used to implement the protected type.
diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb
index 8f191be3a36..e04d723e79f 100644
--- a/gcc/ada/exp_pakd.adb
+++ b/gcc/ada/exp_pakd.adb
@@ -1774,7 +1774,7 @@ package body Exp_Pakd is
Ltyp := Etype (L);
Rtyp := Etype (R);
- -- Deeal with silly case of XOR where the subcomponent has a range
+ -- Deal with silly case of XOR where the subcomponent has a range
-- True .. True where an exception must be raised.
if Nkind (N) = N_Op_Xor then
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 12fea51a197..fd9fe26dd15 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -967,7 +967,7 @@ package body Exp_Util is
-- A protected type without entries that covers an interface and
-- overrides the abstract routines with protected procedures is
-- considered equivalent to a protected type with entries in the
- -- context of dispatching select statements. It is sufficent to
+ -- context of dispatching select statements. It is sufficient to
-- check for the presence of an interface list in the declaration
-- node to recognize this case.
@@ -3066,7 +3066,7 @@ package body Exp_Util is
-- Most predefined primitives have internally generated names. Equality
-- must be treated differently; the predefined operation is recognized
- -- as a homgeneous binary operator that returns Boolean.
+ -- as a homogeneous binary operator that returns Boolean.
if Name_Len > TSS_Name_Type'Last then
TSS_Name := TSS_Name_Type (Name_Buffer (Name_Len - TSS_Name'Length + 1
diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb
index b09a5248b88..6770ee96ecb 100644
--- a/gcc/ada/fmap.adb
+++ b/gcc/ada/fmap.adb
@@ -39,7 +39,7 @@ package body Fmap is
No_Mapping_File : Boolean := False;
-- Set to True when the specified mapping file cannot be read in
- -- procedure Initialize, so that no attempt is made to oopen the mapping
+ -- procedure Initialize, so that no attempt is made to open the mapping
-- file in procedure Update_Mapping_File.
function To_Big_String_Ptr is new Unchecked_Conversion
diff --git a/gcc/ada/g-soccon-linux-mips.ads b/gcc/ada/g-soccon-linux-mips.ads
index 8fc50400e24..0f8822e2a07 100644
--- a/gcc/ada/g-soccon-linux-mips.ads
+++ b/gcc/ada/g-soccon-linux-mips.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,7 +38,7 @@
-- This is the version for mips-linux, manually edited for the first shot
-- no mips hardware at hand
-- using http://www.gelato.unsw.edu.au/lxr/source/include/asm-mips/socket.h
--- in order to find differents values
+-- in order to find different values.
-- This file is generated automatically, do not modify it by hand! Instead,
-- make changes to gen-soccon.c and re-run it on each target.
@@ -80,7 +80,7 @@ package GNAT.Sockets.Constants is
EINVAL : constant := 22; -- Invalid argument
EIO : constant := 5; -- Input output error
EISCONN : constant := 106; -- Socket already connected
- ELOOP : constant := 40; -- Too many symbolic lynks
+ ELOOP : constant := 40; -- Too many symbolic links
EMFILE : constant := 24; -- Too many open files
EMSGSIZE : constant := 90; -- Message too long
ENAMETOOLONG : constant := 36; -- Name too long
diff --git a/gcc/ada/g-soccon-rtems.ads b/gcc/ada/g-soccon-rtems.ads
index f2edb1736e3..a404eec9b33 100644
--- a/gcc/ada/g-soccon-rtems.ads
+++ b/gcc/ada/g-soccon-rtems.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -77,7 +77,7 @@ package GNAT.Sockets.Constants is
EINVAL : constant := 22; -- Invalid argument
EIO : constant := 5; -- Input output error
EISCONN : constant := 127; -- Socket already connected
- ELOOP : constant := 92; -- Too many symbolic lynks
+ ELOOP : constant := 92; -- Too many symbolic links
EMFILE : constant := 24; -- Too many open files
EMSGSIZE : constant := 122; -- Message too long
ENAMETOOLONG : constant := 91; -- Name too long
diff --git a/gcc/ada/g-timsta.adb b/gcc/ada/g-timsta.adb
index 9b643f7cf61..31130c06071 100644
--- a/gcc/ada/g-timsta.adb
+++ b/gcc/ada/g-timsta.adb
@@ -39,7 +39,7 @@ package body GNAT.Time_Stamp is
type time_stamp_ptr is access all time_stamp;
-- The desired ISO 8601 string format has exactly 22 characters. We add
-- one additional character for '\0'. The indexing starts from zero to
- -- accomodate the C layout.
+ -- accommodate the C layout.
procedure gnat_current_time_string (Value : time_stamp_ptr);
pragma Import (C, gnat_current_time_string, "__gnat_current_time_string");
diff --git a/gcc/ada/g-timsta.ads b/gcc/ada/g-timsta.ads
index 87a07f89394..460b7e5eb09 100644
--- a/gcc/ada/g-timsta.ads
+++ b/gcc/ada/g-timsta.ads
@@ -31,7 +31,7 @@
-- --
------------------------------------------------------------------------------
--- This package provides a lighweight mechanism for obtaining time stamps
+-- This package provides a lightweight mechanism for obtaining time stamps
package GNAT.Time_Stamp is
diff --git a/gcc/ada/gen-soccon.c b/gcc/ada/gen-soccon.c
index 9067a146b0b..0d0a037320d 100644
--- a/gcc/ada/gen-soccon.c
+++ b/gcc/ada/gen-soccon.c
@@ -267,7 +267,7 @@ CND(EISCONN, "Socket already connected")
#ifndef ELOOP
#define ELOOP -1
#endif
-CND(ELOOP, "Too many symbolic lynks")
+CND(ELOOP, "Too many symbolic links")
#ifndef EMFILE
#define EMFILE -1
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 8e3247d274d..f8d5939b708 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -3551,7 +3551,7 @@ optimization setting. This would normally be achieved by use of a configuration
pragma file containing the appropriate setting. The exception to this rule is
that units with an explicit configuration pragma in the same file as the source
unit are excluded from the consistency check, as are all predefined units. The
-latter are commpiled by default in pragma Optimize_Alignment (Off) mode if no
+latter are compiled by default in pragma Optimize_Alignment (Off) mode if no
pragma appears at the start of the file.
@node Pragma Passive
@@ -3740,7 +3740,7 @@ will be used as the exception message. If no message
argument was supplied, then the default message has
the form "Postcondition failed at file:line". The
exception is raised in the context of the subprogram
-body, so it is posssible to catch postcondition failures
+body, so it is possible to catch postcondition failures
within the subprogram body itself.
Within a package spec, normal visibility rules
diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads
index f152742bfa7..e0c0f34427d 100644
--- a/gcc/ada/lib-writ.ads
+++ b/gcc/ada/lib-writ.ads
@@ -472,7 +472,7 @@ package Lib.Writ is
-- elaboration code is required. Set if N_Compilation_Unit
-- node has flag Has_No_Elaboration_Code set.
--
- -- OL The units in this file are commpiled with a local pragma
+ -- OL The units in this file are compiled with a local pragma
-- Optimize_Alignment, so no consistency requirement applies
-- to these units. All internal units have this status since
-- they have an automatic default of Optimize_Alignment (Off).
@@ -481,11 +481,11 @@ package Lib.Writ is
-- units in this file. All files in the partition that specify
-- a default must specify the same default.
--
- -- OS Optimize_Alignment (Space) is the default settinng for all
+ -- OS Optimize_Alignment (Space) is the default setting for all
-- units in this file. All files in the partition that specify
-- a default must specify the same default.
--
- -- OT Optimize_Alignment (Time) is the default settinng for all
+ -- OT Optimize_Alignment (Time) is the default setting for all
-- units in this file. All files in the partition that specify
-- a default must specify the same default.
--
diff --git a/gcc/ada/mlib-tgt-specific-linux.adb b/gcc/ada/mlib-tgt-specific-linux.adb
index 60557fdf579..8559966bfe5 100644
--- a/gcc/ada/mlib-tgt-specific-linux.adb
+++ b/gcc/ada/mlib-tgt-specific-linux.adb
@@ -7,7 +7,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -68,7 +68,7 @@ package body MLib.Tgt.Specific is
pragma Unreferenced (Interfaces);
pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Auto_Init);
- -- Initialization is done through the contructor mechanism
+ -- Initialization is done through the constructor mechanism
Lib_File : constant String :=
"lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
diff --git a/gcc/ada/mlib-tgt-specific-tru64.adb b/gcc/ada/mlib-tgt-specific-tru64.adb
index 7e6bcc20605..b5f5a137122 100644
--- a/gcc/ada/mlib-tgt-specific-tru64.adb
+++ b/gcc/ada/mlib-tgt-specific-tru64.adb
@@ -24,7 +24,7 @@
-- --
------------------------------------------------------------------------------
--- This is the True64 version of the body
+-- This is the Tru64 version of the body
with MLib.Fil;
with MLib.Utl;
diff --git a/gcc/ada/s-interr-vxworks.adb b/gcc/ada/s-interr-vxworks.adb
index 98254e617be..a752b2dbd4c 100644
--- a/gcc/ada/s-interr-vxworks.adb
+++ b/gcc/ada/s-interr-vxworks.adb
@@ -607,7 +607,7 @@ package body System.Interrupts is
-- signals and exceptions). As opposed to the signal implementation,
-- this handler is installed in the vector table when the first Ada
-- handler is attached to the interrupt. However because VxWorks don't
- -- support disconnecting handlers, this subprogram always test wether
+ -- support disconnecting handlers, this subprogram always test whether
-- or not an Ada handler is effectively attached.
-- Otherwise, the handler that existed prior to program startup is
diff --git a/gcc/ada/s-interr.adb b/gcc/ada/s-interr.adb
index 44411125493..4cb2ccc57d4 100644
--- a/gcc/ada/s-interr.adb
+++ b/gcc/ada/s-interr.adb
@@ -1244,7 +1244,7 @@ package body System.Interrupts is
-- There are two Interrupt interrupts that this task catch through
-- "sigwait." One is the Interrupt this task is designated to catch
- -- in order to execure user handler or entry. The other one is the
+ -- in order to execute user handler or entry. The other one is the
-- Abort_Task_Interrupt. This interrupt is being sent from the
-- Interrupt_Manager to inform status changes (e.g: become Blocked,
-- Handler or Entry is to be detached).
diff --git a/gcc/ada/s-osinte-lynxos.ads b/gcc/ada/s-osinte-lynxos.ads
index dd30d242176..6acb132011f 100644
--- a/gcc/ada/s-osinte-lynxos.ads
+++ b/gcc/ada/s-osinte-lynxos.ads
@@ -173,7 +173,7 @@ package System.OS_Interface is
SA_SIGINFO : constant := 16#80#;
SA_ONSTACK : constant := 16#00#;
- -- SA_ONSTACK is not defined on LynxOS, but it is refered to in the POSIX
+ -- SA_ONSTACK is not defined on LynxOS, but it is referred to in the POSIX
-- implementation of System.Interrupt_Management. Therefore we define a
-- dummy value of zero here so that setting this flag is a nop.
diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads
index c28ba3c5a92..2c5ffb60832 100644
--- a/gcc/ada/s-rident.ads
+++ b/gcc/ada/s-rident.ads
@@ -282,7 +282,7 @@ package System.Rident is
-- If an entry for a parameter restriction is True in Violated, the
-- corresponding entry in the Unknown array may record additional
-- information. If the actual count is not known by the compiler (but
- -- is nown to be non-zero), then the entry in Unknown will be True.
+ -- is known to be non-zero), then the entry in Unknown will be True.
-- This indicates that the value in Count is not known to be exact,
-- and the actual violation count may be higher.
diff --git a/gcc/ada/s-taprop-solaris.adb b/gcc/ada/s-taprop-solaris.adb
index 2555eb8fee3..7792232fdd8 100644
--- a/gcc/ada/s-taprop-solaris.adb
+++ b/gcc/ada/s-taprop-solaris.adb
@@ -115,7 +115,7 @@ package body System.Task_Primitives.Operations is
-- and priority handling.
Using_Real_Time_Class : Boolean := False;
- -- indicates whether the real time class is being used (i.e the process
+ -- indicates whether the real time class is being used (i.e. the process
-- has root privileges).
Prio_Param : aliased struct_pcparms;
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb
index 65cc80b24f7..d3c6739fb3d 100644
--- a/gcc/ada/s-tassta.adb
+++ b/gcc/ada/s-tassta.adb
@@ -1193,7 +1193,7 @@ package body System.Tasking.Stages is
-- Terminate_Task --
--------------------
- -- Before we allow the thread to exit, we must clean up. This is a a
+ -- Before we allow the thread to exit, we must clean up. This is a
-- delicate job. We must wake up the task's master, who may immediately try
-- to deallocate the ATCB out from under the current task WHILE IT IS STILL
-- EXECUTING.
diff --git a/gcc/ada/s-win32.ads b/gcc/ada/s-win32.ads
index 2d2648514b8..298984cb3b3 100644
--- a/gcc/ada/s-win32.ads
+++ b/gcc/ada/s-win32.ads
@@ -32,7 +32,7 @@
------------------------------------------------------------------------------
-- This package plus its child provide the low level interface to the Win32
--- API. The core part of the Win32 API (commont to RTX and Win32) is in this
+-- API. The core part of the Win32 API (common to RTX and Win32) is in this
-- package, and an additional part of the Win32 API which is not supported by
-- RTX is in package System.Win33.Ext.
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 5c7d9bd7dda..051a650f9c2 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1937,7 +1937,7 @@ package body Sem_Aggr is
end if;
end if;
- -- If no others, aggregate bounds come from aggegate
+ -- If no others, aggregate bounds come from aggregate
Aggr_Low := Choices_Low;
Aggr_High := Choices_High;
diff --git a/gcc/ada/sem_attr.ads b/gcc/ada/sem_attr.ads
index 30dda4304e1..126c358be9f 100644
--- a/gcc/ada/sem_attr.ads
+++ b/gcc/ada/sem_attr.ads
@@ -297,7 +297,7 @@ package Sem_Attr is
-- is identical to the value that would be set if Initialize_Scalars
-- mode were in effect (including the behavior of its value on
-- environment variables or binder switches). The intended use is
- -- to set a value where intialization is required (e.g. as a result of
+ -- to set a value where initialization is required (e.g. as a result of
-- the coding standards in use), but logically no initialization is
-- needed, and the value should never be accessed.
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 637e15351e5..540b2a6d85d 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -3969,7 +3969,7 @@ package body Sem_Ch10 is
end loop;
-- Now check incomplete declarations to locate Taft amendment
- -- types. This can be done by examing the defining identifiers
+ -- types. This can be done by examining the defining identifiers
-- of type declarations without real semantic analysis.
declare
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index e7755c4f534..60833fc2bdb 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -2361,30 +2361,34 @@ package body Sem_Ch12 is
-- Default name may be overloaded, in which case the interpretation
-- with the correct profile must be selected, as for a renaming.
+ -- If the definition is an indexed component, it must denote a
+ -- member of an entry family. If it is a selected component, it
+ -- can be a protected operation.
if Etype (Def) = Any_Type then
return;
elsif Nkind (Def) = N_Selected_Component then
- Subp := Entity (Selector_Name (Def));
-
- if Ekind (Subp) /= E_Entry then
+ if not Is_Overloadable (Entity (Selector_Name (Def))) then
Error_Msg_N ("expect valid subprogram name as default", Def);
- return;
end if;
elsif Nkind (Def) = N_Indexed_Component then
- if Nkind (Prefix (Def)) /= N_Selected_Component then
- Error_Msg_N ("expect valid subprogram name as default", Def);
- return;
-
- else
- Subp := Entity (Selector_Name (Prefix (Def)));
+ if Is_Entity_Name (Prefix (Def)) then
+ if Ekind (Entity (Prefix (Def))) /= E_Entry_Family then
+ Error_Msg_N ("expect valid subprogram name as default", Def);
+ end if;
- if Ekind (Subp) /= E_Entry_Family then
+ elsif Nkind (Prefix (Def)) = N_Selected_Component then
+ if Ekind (Entity (Selector_Name (Prefix (Def))))
+ /= E_Entry_Family
+ then
Error_Msg_N ("expect valid subprogram name as default", Def);
- return;
end if;
+
+ else
+ Error_Msg_N ("expect valid subprogram name as default", Def);
+ return;
end if;
elsif Nkind (Def) = N_Character_Literal then
@@ -2410,6 +2414,9 @@ package body Sem_Ch12 is
end if;
else
+
+ -- Several interpretations. Disambiguate as for a renaming.
+
declare
I : Interp_Index;
I1 : Interp_Index := 0;
@@ -9778,6 +9785,8 @@ package body Sem_Ch12 is
-- interface then the generic formal is not unless declared
-- explicitly so. If not declared limited, the actual cannot be
-- limited (see AI05-0087).
+ -- Disable check for now, limited interfaces implemented by
+ -- protected types are common, Need to update tests ???
if Is_Limited_Type (Act_T)
and then not Is_Limited_Type (A_Gen_T)
@@ -9981,7 +9990,7 @@ package body Sem_Ch12 is
Ekind (Root_Type (Act_T)) = E_Incomplete_Type)
then
if Is_Class_Wide_Type (Act_T)
- or else No (Underlying_Type (Act_T))
+ or else No (Full_View (Act_T))
then
Error_Msg_N ("premature use of incomplete type", Actual);
Abandon_Instantiation (Actual);
diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads
index 427f836f6e7..e7c20bc8e12 100644
--- a/gcc/ada/sem_ch13.ads
+++ b/gcc/ada/sem_ch13.ads
@@ -122,7 +122,7 @@ package Sem_Ch13 is
-- attributes, clearly should not be subject to the para 10 restrictions
-- (see AI95-00137). Similarly, we also skip the para 10 restrictions for
-- the Storage_Size case where they also clearly do not apply, and for
- -- Stream_Convert which is in the same category as the strem attributes.
+ -- Stream_Convert which is in the same category as the stream attributes.
--
-- If the rep item is too late, an appropriate message is output and
-- True is returned, which is a signal that the caller should abandon
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 88ee0d55b18..103eb75fbe5 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -2308,7 +2308,7 @@ package body Sem_Ch3 is
-- The current object is a discriminal generated for an entry
-- family index. Even though the index is a constant, in this
- -- particular context there is no true contant redeclaration.
+ -- particular context there is no true constant redeclaration.
-- Enter_Name will handle the visibility.
or else
@@ -8153,7 +8153,7 @@ package body Sem_Ch3 is
if Present (Alias_Subp) then
-- Only perform the check for a derived subprogram when the
- -- type has an explicit record extension. This avoids incorect
+ -- type has an explicit record extension. This avoids incorrect
-- flagging of abstract subprograms for the case of a type
-- without an extension that is derived from a formal type
-- with a tagged actual (can occur within a private part).
@@ -11798,7 +11798,7 @@ package body Sem_Ch3 is
-- If we are creating a renaming for a primitive operation of an
-- actual of a generic derived type, we must examine the signature
- -- of the actual primive, not that of the generic formal, which for
+ -- of the actual primitive, not that of the generic formal, which for
-- example may be an interface. However the name and initial value
-- of the inherited operation are those of the formal primitive.
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 4d566d76b5f..fbac48cd1af 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -2020,7 +2020,7 @@ package body Sem_Ch6 is
Process_PPCs (N, Spec_Id, Body_Id);
- -- Add a declaration for the Protection objcect, renaming declarations
+ -- Add a declaration for the Protection object, renaming declarations
-- for discriminals and privals and finally a declaration for the entry
-- family index (if applicable). This form of early expansion is done
-- when the Expander is active because Install_Private_Data_Declarations
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index ebeec699183..fe1bcb5f24f 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -1002,7 +1002,7 @@ package body Sem_Ch7 is
-- is both unnecessary and wrong, because it would cause the
-- clauses to be chained to themselves in the use clauses
-- list of the scope stack entry. That in turn would cause
- -- an endless loop from End_Use_Clauses upon sccope exit.
+ -- an endless loop from End_Use_Clauses upon scope exit.
-- The parent is now fully visible. It may be a hidden open
-- scope if we are currently compiling some child instance
@@ -1383,7 +1383,7 @@ package body Sem_Ch7 is
begin
-- If the full view is a scalar type, the type is the anonymous
-- base type, but the operation mentions the first subtype, so
- -- check the signature againt the base type.
+ -- check the signature against the base type.
if Base_Type (Etype (S)) = Base_Type (T) then
return True;
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index da77f581327..3b28bdfe868 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -2396,6 +2396,11 @@ package body Sem_Ch8 is
Use_One_Package (Pack, N);
end if;
end if;
+
+ -- Report error because name denotes something other than a package
+
+ else
+ Error_Msg_N ("& is not a package", Pack_Name);
end if;
Next (Pack_Name);
@@ -3066,9 +3071,14 @@ package body Sem_Ch8 is
begin
Pack_Name := First (Names (N));
while Present (Pack_Name) loop
- Pack := Entity (Pack_Name);
- if Ekind (Pack) = E_Package then
+ -- Test that Pack_Name actually denotes a package before processing
+
+ if Is_Entity_Name (Pack_Name)
+ and then Ekind (Entity (Pack_Name)) = E_Package
+ then
+ Pack := Entity (Pack_Name);
+
if In_Open_Scopes (Pack) then
null;
@@ -4110,7 +4120,7 @@ package body Sem_Ch8 is
-- If the renamed entity is a private protected component,
-- reference the original component as well. This needs to be
-- done because the private renamings are installed before any
- -- analysis has occured. Reference to a private component will
+ -- analysis has occurred. Reference to a private component will
-- resolve to the renaming and the original component will be
-- left unreferenced, hence the following.
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index d9e7ff9ca5a..fe3634e8fe9 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -1113,7 +1113,7 @@ package body Sem_Ch9 is
-- all itypes within are frozen. This ensures that no freeze nodes
-- will be generated for them.
--
- -- On the other hand, components of the correesponding record are
+ -- On the other hand, components of the corresponding record are
-- frozen (or receive itype references) as for other records.
--------------------
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index c238367ba83..6b819803705 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -8450,10 +8450,10 @@ package body Sem_Prag is
Check_Arg_Is_Library_Level_Local_Name (Arg1);
Check_Arg_Is_Static_Expression (Arg2, Standard_String);
- -- This pragma does not apply to types
+ -- This pragma applies only to objects
- if Is_Type (Entity (Expression (Arg1))) then
- Error_Pragma_Arg ("pragma% cannot apply to type", Arg1);
+ if not Is_Object (Entity (Expression (Arg1))) then
+ Error_Pragma_Arg ("pragma% applies only to objects", Arg1);
end if;
-- The only processing required is to link this item on to the
diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads
index 1bb51150417..b5e843a62b0 100644
--- a/gcc/ada/sem_prag.ads
+++ b/gcc/ada/sem_prag.ads
@@ -51,7 +51,7 @@ package Sem_Prag is
-- Precondition, and Postcondition to determine if Check pragmas (or
-- corresponding Assert, Precondition, or Postcondition pragmas) are
-- currently active, as determined by the presence of -gnata on the
- -- command line (which sets the default), and the appearence of pragmas
+ -- command line (which sets the default), and the appearance of pragmas
-- Check_Policy and Assertion_Policy as configuration pragmas either in
-- a configuration pragma file, or at the start of the current unit.
-- True is returned if the specified check is enabled.
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index cfa1a8cd0d7..39cd89514fb 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -396,7 +396,7 @@ package body Sem_Res is
D : Node_Id;
begin
- -- Any use in a a spec-expression is legal
+ -- Any use in a spec-expression is legal
if In_Spec_Expression then
null;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index fd797ca6079..1be22cf7df0 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -492,7 +492,7 @@ package body Sem_Util is
if In_Spec_Expression then
return Empty;
- -- More commments for the rest of this body would be good ???
+ -- More comments for the rest of this body would be good ???
elsif Nkind (N) = N_Explicit_Dereference then
if Is_Composite_Type (T)
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index a5cb1db6694..a14d6a0149f 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1089,7 +1089,7 @@ package Sem_Util is
procedure Set_Optimize_Alignment_Flags (E : Entity_Id);
pragma Inline (Set_Optimize_Alignment_Flags);
- -- Sets Optimize_Aliignment_Space/Time flags in E from current settings
+ -- Sets Optimize_Alignment_Space/Time flags in E from current settings
procedure Set_Public_Status (Id : Entity_Id);
-- If an entity (visible or otherwise) is defined in a library
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index bcf4eb8a49b..4686a7ac096 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -1369,7 +1369,7 @@ package Sinfo is
-- Next_Pragma (Node1-Sem)
-- Present in N_Pragma nodes. Used to create a linked list of pragma
- -- nodes. Curently used for two purposes:
+ -- nodes. Currently used for two purposes:
--
-- Create a list of linked Check_Policy pragmas. The head of this list
-- is stored in Opt.Check_Policy_List (which has further details).
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index b00f5c3af05..300ac780f20 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -996,8 +996,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* Remove NOPS from gnu_expr and conversions from gnu_prefix.
We only use GNU_EXPR to see if a COMPONENT_REF was involved. */
while (TREE_CODE (gnu_expr) == NOP_EXPR)
- gnu_expr = TREE_OPERAND (gnu_expr, 0)
- ;
+ gnu_expr = TREE_OPERAND (gnu_expr, 0);
gnu_prefix = remove_conversions (gnu_prefix, true);
prefix_unused = true;
@@ -1018,7 +1017,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* If we're looking for the size of a field, return the field size.
Otherwise, if the prefix is an object, or if 'Object_Size or
'Max_Size_In_Storage_Elements has been specified, the result is the
- GCC size of the type. Otherwise, the result is the RM_Size of the
+ GCC size of the type. Otherwise, the result is the RM_Size of the
type. */
if (TREE_CODE (gnu_prefix) == COMPONENT_REF)
gnu_result = DECL_SIZE (TREE_OPERAND (gnu_prefix, 1));
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 3c6cb0074eb..5888bc583c4 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -687,23 +687,38 @@ build_binary_op (enum tree_code op_code, tree result_type,
left_type = TREE_TYPE (left_operand);
}
- if (!operation_type)
- operation_type = left_type;
-
- /* Find the best type to use for copying between aggregate types. */
- if (((TREE_CODE (left_type) == ARRAY_TYPE
- && TREE_CODE (right_type) == ARRAY_TYPE)
- || (TREE_CODE (left_type) == RECORD_TYPE
- && TREE_CODE (right_type) == RECORD_TYPE))
- && (best_type = find_common_type (left_type, right_type)))
- operation_type = best_type;
-
/* If a class-wide type may be involved, force use of the RHS type. */
if ((TREE_CODE (right_type) == RECORD_TYPE
|| TREE_CODE (right_type) == UNION_TYPE)
&& TYPE_ALIGN_OK (right_type))
operation_type = right_type;
+ /* If we are copying between padded objects of the same underlying
+ type with a non-zero size, use the padded view of the type, this
+ is very likely more efficient. */
+ else if (TREE_CODE (left_type) == RECORD_TYPE
+ && TYPE_IS_PADDING_P (left_type)
+ && TREE_TYPE (TYPE_FIELDS (left_type)) == right_type
+ && !integer_zerop (TYPE_SIZE (right_type))
+ && TREE_CODE (right_operand) == COMPONENT_REF
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
+ == RECORD_TYPE
+ && TYPE_IS_PADDING_P
+ (TREE_TYPE (TREE_OPERAND (right_operand, 0))))
+ operation_type = left_type;
+
+ /* Find the best type to use for copying between aggregate types. */
+ else if (((TREE_CODE (left_type) == ARRAY_TYPE
+ && TREE_CODE (right_type) == ARRAY_TYPE)
+ || (TREE_CODE (left_type) == RECORD_TYPE
+ && TREE_CODE (right_type) == RECORD_TYPE))
+ && (best_type = find_common_type (left_type, right_type)))
+ operation_type = best_type;
+
+ /* Otherwise use the LHS type. */
+ else if (!operation_type)
+ operation_type = left_type;
+
/* Ensure everything on the LHS is valid. If we have a field reference,
strip anything that get_inner_reference can handle. Then remove any
conversions between types having the same code and mode. And mark
diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads
index 7dc0bf003f4..4a48396aec7 100644
--- a/gcc/ada/vms_data.ads
+++ b/gcc/ada/vms_data.ads
@@ -5152,7 +5152,7 @@ package VMS_Data is
"ALL_ON " &
"--coupling-all " &
"ALL_OFF " &
- "--no-counling-all " &
+ "--no-coupling-all " &
"PACKAGE_EFFERENT_ON " &
"--package-efferent-coupling " &
"PACKAGE_EFFERENT_OFF " &
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 7e609deeb50..ceb2f0666c3 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -4332,7 +4332,8 @@ match_case_to_enum_1 (tree key, tree type, tree label)
-TREE_INT_CST_LOW (key));
else
snprintf (buf, sizeof (buf), HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- TREE_INT_CST_HIGH (key), TREE_INT_CST_LOW (key));
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (key),
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (key));
if (TYPE_NAME (type) == 0)
warning (warn_switch ? OPT_Wswitch : OPT_Wswitch_enum,
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 22491aaec6a..872fb8af30b 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3481,7 +3481,10 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
else
- error ("storage size of %q+D isn%'t constant", decl);
+ {
+ error ("storage size of %q+D isn%'t constant", decl);
+ TREE_TYPE (decl) = error_mark_node;
+ }
}
if (TREE_USED (type))
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 39044a3cebd..3c2f0218461 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -832,8 +832,8 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
high = ~high + !low;
low = -low;
}
- sprintf (pp_buffer (pp)->digit_buffer,
- HOST_WIDE_INT_PRINT_DOUBLE_HEX, high, low);
+ sprintf (pp_buffer (pp)->digit_buffer, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
+ (unsigned HOST_WIDE_INT) high, (unsigned HOST_WIDE_INT) low);
pp_string (pp, pp_buffer (pp)->digit_buffer);
}
if (TYPE_UNSIGNED (type))
diff --git a/gcc/calls.c b/gcc/calls.c
index b747fd4057a..8ae65a5f6e3 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -389,7 +389,6 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
if (rn > 0)
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (rn),
REG_NOTES (call_insn));
- note_current_region_may_contain_throw ();
}
if (ecf_flags & ECF_NORETURN)
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 02d3b684ae8..867bb08dd5c 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5449,7 +5449,7 @@ void
alpha_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt,
int fnofs, int cxtofs, int jmpofs)
{
- rtx temp, temp1, addr;
+ rtx addr;
/* VMS really uses DImode pointers in memory at this point. */
enum machine_mode mode = TARGET_ABI_OPEN_VMS ? Pmode : ptr_mode;
diff --git a/gcc/config/bfin/constraints.md b/gcc/config/bfin/constraints.md
new file mode 100644
index 00000000000..fa9dcf14399
--- /dev/null
+++ b/gcc/config/bfin/constraints.md
@@ -0,0 +1,225 @@
+;; Constraint definitions for Blackfin
+;; Copyright (C) 2008 Free Software Foundation, Inc.
+;; Contributed by Analog Devices
+
+;; This file is part of GCC.
+
+;; GCC is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published
+;; by the Free Software Foundation; either version 3, or (at your
+;; option) any later version.
+
+;; GCC is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+;; License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+(define_register_constraint "a" "PREGS"
+ "A Pn register.")
+
+(define_register_constraint "d" "DREGS"
+ "A Rn register.")
+
+(define_register_constraint "z" "PREGS_CLOBBERED"
+ "A call clobbered Pn register.")
+
+(define_register_constraint "D" "EVEN_DREGS"
+ "An even-numbered Rn register.")
+
+(define_register_constraint "W" "ODD_DREGS"
+ "An odd-numbered Rn register.")
+
+(define_register_constraint "e" "AREGS"
+ "An accumulator register.")
+
+(define_register_constraint "A" "EVEN_AREGS"
+ "An even-numbered accumulator; A0.")
+
+(define_register_constraint "B" "ODD_AREGS"
+ "An odd-numbered accumulator; A1.")
+
+(define_register_constraint "b" "IREGS"
+ "An I register.")
+
+(define_register_constraint "v" "BREGS"
+ "A B register.")
+
+(define_register_constraint "f" "MREGS"
+ "An M register.")
+
+(define_register_constraint "c" "CIRCREGS"
+ "A register used for circular buffering, i.e. I, B, or L registers.")
+
+(define_register_constraint "C" "CCREGS"
+ "The CC register.")
+
+(define_register_constraint "t" "LT_REGS"
+ "LT0 or LT1.")
+
+(define_register_constraint "u" "LB_REGS"
+ "LB0 or LB1.")
+
+(define_register_constraint "k" "LC_REGS"
+ "LC0 or LC1.")
+
+(define_register_constraint "x" "MOST_REGS"
+ "Any R, P, B, M, I or L register.")
+
+(define_register_constraint "y" "PROLOGUE_REGS"
+ "Additional registers typically used only in prologues and epilogues:
+ RETS, RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and USP.")
+
+(define_register_constraint "w" "NON_A_CC_REGS"
+ "Any register except accumulators or CC.")
+
+(define_register_constraint "Z" "FDPIC_REGS"
+ "@internal The FD-PIC GOT pointer; P3.")
+
+(define_register_constraint "Y" "FDPIC_FPTR_REGS"
+ "@internal The FD-PIC function pointer register; P1.")
+
+(define_register_constraint "q0" "D0REGS"
+ "The register R0.")
+
+(define_register_constraint "q1" "D1REGS"
+ "The register R1.")
+
+(define_register_constraint "q2" "D2REGS"
+ "The register R2.")
+
+(define_register_constraint "q3" "D3REGS"
+ "The register R3.")
+
+(define_register_constraint "q4" "D4REGS"
+ "The register R4.")
+
+(define_register_constraint "q5" "D5REGS"
+ "The register R5.")
+
+(define_register_constraint "q6" "D6REGS"
+ "The register R6.")
+
+(define_register_constraint "q7" "D7REGS"
+ "The register R7.")
+
+(define_register_constraint "qA" "P0REGS"
+ "The register P0.")
+
+;; Constant constraints.
+
+(define_constraint "J"
+ "A constant value of the form 2**N, where N 5-bit wide."
+ (and (match_code "const_int")
+ (match_test "log2constp (ival)")))
+
+(define_constraint "Ks3"
+ "A signed 3 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -4 && ival <= 3")))
+
+(define_constraint "Ku3"
+ "An unsigned 3 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 7")))
+
+(define_constraint "Ks4"
+ "A signed 4 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -8 && ival <= 7")))
+
+(define_constraint "Ku4"
+ "An unsigned 4 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 15")))
+
+(define_constraint "Ks5"
+ "A signed 5 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -16 && ival <= 15")))
+
+(define_constraint "Ku5"
+ "An unsigned 5 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 31")))
+
+(define_constraint "Ks7"
+ "A signed 7 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -64 && ival <= 63")))
+
+(define_constraint "KN7"
+ "A constant that when negated is a signed 7 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -63 && ival <= 64")))
+
+(define_constraint "Ksh"
+ "A signed 16 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -32768 && ival <= 32767")))
+
+(define_constraint "Kuh"
+ "An unsigned 16 bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 65535")))
+
+(define_constraint "L"
+ "A constant value of the form ~(2**N)."
+ (and (match_code "const_int")
+ (match_test "log2constp (~ival)")))
+
+(define_constraint "M1"
+ "An integer with the value 255."
+ (and (match_code "const_int")
+ (match_test "ival == 255")))
+
+(define_constraint "M2"
+ "An integer with the value 65535."
+ (and (match_code "const_int")
+ (match_test "ival == 65535")))
+
+(define_constraint "P0"
+ "An integer with the value 0."
+ (and (match_code "const_int")
+ (match_test "ival == 0")))
+
+(define_constraint "P1"
+ "An integer with the value 1."
+ (and (match_code "const_int")
+ (match_test "ival == 1")))
+
+(define_constraint "P2"
+ "An integer with the value 2."
+ (and (match_code "const_int")
+ (match_test "ival == 2")))
+
+(define_constraint "P3"
+ "An integer with the value 3."
+ (and (match_code "const_int")
+ (match_test "ival == 3")))
+
+(define_constraint "P4"
+ "An integer with the value 4."
+ (and (match_code "const_int")
+ (match_test "ival == 4")))
+
+(define_constraint "PA"
+ "An integer constant describing any macflag except variants involving M."
+ (and (match_code "const_int")
+ (match_test "ival != MACFLAG_M && ival != MACFLAG_IS_M")))
+
+(define_constraint "PB"
+ "An integer constant describing any macflag involving M."
+ (and (match_code "const_int")
+ (match_test "ival == MACFLAG_M || ival == MACFLAG_IS_M")))
+
+
+;; Extra constraints
+
+(define_constraint "Q"
+ "A SYMBOL_REF."
+ (match_code "symbol_ref"))
+
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6fcbe6637e1..4bb686f818b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -9288,7 +9288,7 @@ print_operand (FILE *file, rtx x, int code)
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('$', file);
- fprintf (file, "0x%08lx", l);
+ fprintf (file, "0x%08lx", (long unsigned int) l);
}
/* These float cases don't actually occur as immediate operands. */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index d428c3b58d9..d09eb260f4e 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -16434,28 +16434,24 @@
(define_expand "fmodxf3"
[(use (match_operand:XF 0 "register_operand" ""))
- (use (match_operand:XF 1 "register_operand" ""))
- (use (match_operand:XF 2 "register_operand" ""))]
+ (use (match_operand:XF 1 "general_operand" ""))
+ (use (match_operand:XF 2 "general_operand" ""))]
"TARGET_USE_FANCY_MATH_387"
{
rtx label = gen_label_rtx ();
- rtx op2;
+ rtx op1 = gen_reg_rtx (XFmode);
+ rtx op2 = gen_reg_rtx (XFmode);
- if (rtx_equal_p (operands[1], operands[2]))
- {
- op2 = gen_reg_rtx (XFmode);
- emit_move_insn (op2, operands[2]);
- }
- else
- op2 = operands[2];
+ emit_move_insn (op1, operands[1]);
+ emit_move_insn (op2, operands[2]);
emit_label (label);
- emit_insn (gen_fpremxf4_i387 (operands[1], op2, operands[1], op2));
+ emit_insn (gen_fpremxf4_i387 (op1, op2, op1, op2));
ix86_emit_fp_unordered_jump (label);
LABEL_NUSES (label) = 1;
- emit_move_insn (operands[0], operands[1]);
+ emit_move_insn (operands[0], op1);
DONE;
})
@@ -16506,28 +16502,24 @@
(define_expand "remainderxf3"
[(use (match_operand:XF 0 "register_operand" ""))
- (use (match_operand:XF 1 "register_operand" ""))
- (use (match_operand:XF 2 "register_operand" ""))]
+ (use (match_operand:XF 1 "general_operand" ""))
+ (use (match_operand:XF 2 "general_operand" ""))]
"TARGET_USE_FANCY_MATH_387"
{
rtx label = gen_label_rtx ();
- rtx op2;
+ rtx op1 = gen_reg_rtx (XFmode);
+ rtx op2 = gen_reg_rtx (XFmode);
- if (rtx_equal_p (operands[1], operands[2]))
- {
- op2 = gen_reg_rtx (XFmode);
- emit_move_insn (op2, operands[2]);
- }
- else
- op2 = operands[2];
+ emit_move_insn (op1, operands[1]);
+ emit_move_insn (op2, operands[2]);
emit_label (label);
- emit_insn (gen_fprem1xf4_i387 (operands[1], op2, operands[1], op2));
+ emit_insn (gen_fprem1xf4_i387 (op1, op2, op1, op2));
ix86_emit_fp_unordered_jump (label);
LABEL_NUSES (label) = 1;
- emit_move_insn (operands[0], operands[1]);
+ emit_move_insn (operands[0], op1);
DONE;
})
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 4d93573506e..35d7f9f9eac 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -420,6 +420,15 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc)
flags = SECTION_CODE;
else if (decl && decl_readonly_section (decl, reloc))
flags = 0;
+ else if (current_function_decl
+ && cfun
+ && crtl->subsections.unlikely_text_section_name
+ && strcmp (name, crtl->subsections.unlikely_text_section_name) == 0)
+ flags = SECTION_CODE;
+ else if (!decl
+ && (!current_function_decl || !cfun)
+ && strcmp (name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) == 0)
+ flags = SECTION_CODE;
else
{
flags = SECTION_WRITE;
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 0658b539702..5b48eba14f5 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by James E. Wilson <wilson@cygnus.com> and
David Mosberger <davidm@hpl.hp.com>.
@@ -5887,6 +5887,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred)
case UNSPEC_SETF_EXP:
case UNSPEC_ADDP4:
case UNSPEC_FR_SQRT_RECIP_APPROX:
+ case UNSPEC_FR_SQRT_RECIP_APPROX_RES:
case UNSPEC_LDA:
case UNSPEC_LDS:
case UNSPEC_LDSA:
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 068e607c1e9..7135bf4da58 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -1,5 +1,5 @@
;; IA-64 Machine description template
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
;; Free Software Foundation, Inc.
;; Contributed by James E. Wilson <wilson@cygnus.com> and
;; David Mosberger <davidm@hpl.hp.com>.
@@ -87,6 +87,7 @@
(UNSPEC_CHKACLR 45)
(UNSPEC_CHKS 47)
(UNSPEC_FR_RECIP_APPROX_RES 48)
+ (UNSPEC_FR_SQRT_RECIP_APPROX_RES 49)
])
(define_constants
@@ -2204,7 +2205,8 @@
"TARGET_INLINE_INT_DIV"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2)))
+ [(parallel [(set (match_dup 0) (unspec:XF [(const_int 1) (match_dup 2)]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_dup 6) (unspec:BI [(match_dup 1) (match_dup 2)]
UNSPEC_FR_RECIP_APPROX))
(use (const_int 1))])
@@ -2617,7 +2619,8 @@
"TARGET_INLINE_INT_DIV == INL_MIN_LAT"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2)))
+ [(parallel [(set (match_dup 0) (unspec:XF [(const_int 1) (match_dup 2)]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_dup 6) (unspec:BI [(match_dup 1) (match_dup 2)]
UNSPEC_FR_RECIP_APPROX))
(use (const_int 1))])
@@ -2676,7 +2679,8 @@
"TARGET_INLINE_INT_DIV == INL_MAX_THR"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2)))
+ [(parallel [(set (match_dup 0) (unspec:XF [(const_int 1) (match_dup 2)]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_dup 5) (unspec:BI [(match_dup 1) (match_dup 2)]
UNSPEC_FR_RECIP_APPROX))
(use (const_int 1))])
@@ -3064,7 +3068,8 @@
"TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 6) (div:XF (const_int 1) (match_dup 8)))
+ [(parallel [(set (match_dup 6) (unspec:XF [(const_int 1) (match_dup 8)]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)]
UNSPEC_FR_RECIP_APPROX))
(use (const_int 0))])
@@ -3116,7 +3121,8 @@
(define_insn "*sqrt_approx"
[(set (match_operand:XF 0 "fr_register_operand" "=f")
(div:XF (const_int 1)
- (sqrt:XF (match_operand:XF 2 "fr_register_operand" "f"))))
+ (unspec:XF [(match_operand:XF 2 "fr_register_operand" "f")]
+ UNSPEC_FR_SQRT_RECIP_APPROX_RES)))
(set (match_operand:BI 1 "register_operand" "=c")
(unspec:BI [(match_dup 2)] UNSPEC_FR_SQRT_RECIP_APPROX))
(use (match_operand:SI 3 "const_int_operand" "")) ]
@@ -3181,10 +3187,11 @@
;; y0 = 1/sqrt(a) in f7
(parallel [(set (match_dup 7)
(div:XF (const_int 1)
- (sqrt:XF (match_dup 8))))
+ (unspec:XF [(match_dup 8)]
+ UNSPEC_FR_SQRT_RECIP_APPROX_RES)))
(set (match_dup 6)
(unspec:BI [(match_dup 8)]
- UNSPEC_FR_SQRT_RECIP_APPROX))
+ UNSPEC_FR_SQRT_RECIP_APPROX))
(use (const_int 0))])
;; Step 2
;; H0 = 1/2 * y0 in f9
@@ -3493,7 +3500,8 @@
"TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 7) (div:XF (const_int 1) (match_dup 9)))
+ [(parallel [(set (match_dup 7) (unspec:XF [(const_int 1) (match_dup 9)]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_dup 6) (unspec:BI [(match_dup 8) (match_dup 9)]
UNSPEC_FR_RECIP_APPROX))
(use (const_int 0))])
@@ -3613,10 +3621,11 @@
;; y0 = 1/sqrt(a) in f7
(parallel [(set (match_dup 7)
(div:XF (const_int 1)
- (sqrt:XF (match_dup 8))))
+ (unspec:XF [(match_dup 8)]
+ UNSPEC_FR_SQRT_RECIP_APPROX_RES)))
(set (match_dup 6)
(unspec:BI [(match_dup 8)]
- UNSPEC_FR_SQRT_RECIP_APPROX))
+ UNSPEC_FR_SQRT_RECIP_APPROX))
(use (const_int 0))])
;; Step 2
;; H0 = 1/2 * y0 in f8
@@ -4092,7 +4101,8 @@
"TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2)))
+ [(parallel [(set (match_dup 0) (unspec:XF [(const_int 1) (match_dup 2)]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_dup 7) (unspec:BI [(match_dup 1) (match_dup 2)]
UNSPEC_FR_RECIP_APPROX))
(use (const_int 0))])
@@ -4170,7 +4180,8 @@
"TARGET_INLINE_FLOAT_DIV == INL_MAX_THR"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2)))
+ [(parallel [(set (match_dup 0) (unspec:XF [(const_int 1) (match_dup 2)]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_dup 5) (unspec:BI [(match_dup 1) (match_dup 2)]
UNSPEC_FR_RECIP_APPROX))
(use (const_int 0))])
@@ -4290,10 +4301,11 @@
;; y0 = 1/sqrt(a) in f7
(parallel [(set (match_dup 8)
(div:XF (const_int 1)
- (sqrt:XF (match_dup 9))))
+ (unspec:XF [(match_dup 9)]
+ UNSPEC_FR_SQRT_RECIP_APPROX_RES)))
(set (match_dup 7)
(unspec:BI [(match_dup 9)]
- UNSPEC_FR_SQRT_RECIP_APPROX))
+ UNSPEC_FR_SQRT_RECIP_APPROX))
(use (const_int 0))])
;; Step 2
;; H0 = 1/2 * y0 in f9
@@ -4406,8 +4418,9 @@
(define_insn "*recip_approx"
[(set (match_operand:XF 0 "fr_register_operand" "=f")
- (div:XF (const_int 1)
- (match_operand:XF 3 "fr_register_operand" "f")))
+ (unspec:XF [(const_int 1)
+ (match_operand:XF 3 "fr_register_operand" "f")]
+ UNSPEC_FR_RECIP_APPROX_RES))
(set (match_operand:BI 1 "register_operand" "=c")
(unspec:BI [(match_operand:XF 2 "fr_register_operand" "f")
(match_dup 3)] UNSPEC_FR_RECIP_APPROX))
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1e131656516..22a7420523d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,15 @@
+2008-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35751
+ * decl.c (layout_var_decl): If extern or static var has variable
+ size, set TREE_TYPE (decl) to error_mark_node.
+
+2008-04-16 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR target/35921
+ * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
+ to clone.
+
2008-04-09 Jason Merrill <jason@redhat.com>
PR c++/35708
@@ -2328,7 +2340,7 @@
2007-09-05 Jan Hubicka <jh@suse.cz>
- * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
+ * sematics.c (expand_body): Remove unnecesary import_export_decl
call, DECL_EXTERNAL checks and current_function_decl saving.
2007-09-05 Paolo Carlini <pcarlini@suse.de>
@@ -2755,7 +2767,7 @@
* cp-objcp-common.c (cxx_get_alias_set): Change return type to
alias_set_type.
- * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
+ * cp-tree.h (cxx_get_alias_set): Update declaration.
2007-08-10 Ollie Wild <aaw@google.com>
@@ -3428,7 +3440,7 @@
2007-05-11 Silvius Rus <rus@google.com>
- * cp/typeck.c (build_indirect_ref): Add call to
+ * typeck.c (build_indirect_ref): Add call to
strict_aliasing_warning.
(build_reinterpret_cast_1): Condition call to
strict_aliasing_warning.
@@ -3518,7 +3530,7 @@
2007-04-23 Jan Hubicka <jh@suse.cz>
- * cp/decl2.c (finish_objects): Do not call target constructor/destructor
+ * decl2.c (finish_objects): Do not call target constructor/destructor
bits dirrectly.
2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
@@ -3540,7 +3552,7 @@
2007-04-16 Seongbae Park <seongbae.park@gmail.com>
PR c++/29365
- * cp/decl2.c (constrain_class_visibility):
+ * decl2.c (constrain_class_visibility):
Do not warn about the use of anonymous namespace in the main input file.
2007-04-15 Mark Mitchell <mark@codesourcery.com>
@@ -3559,7 +3571,7 @@
2007-04-11 Jan Hubicka <jh@suse.cz>
- * cp/class.c (convert_to_base_statically): Fold produced tree; verify
+ * class.c (convert_to_base_statically): Fold produced tree; verify
that we are not processing template_decl.
2007-04-09 Mark Mitchell <mark@codesourcery.com>
@@ -3814,7 +3826,7 @@
2007-03-14 Dirk Mueller <dmueller@suse.de>
- * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
+ * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
(finish_do_body): Warn about empty body in do/while statement.
2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
@@ -3829,7 +3841,7 @@
2007-03-13 Alexandre Oliva <aoliva@redhat.com>
- * cp/repo.c (init_repo): Initialize random_seed saved options.
+ * repo.c (init_repo): Initialize random_seed saved options.
(finish_repo): Adjust.
2007-03-13 Mark Mitchell <mark@codesourcery.com>
@@ -4083,7 +4095,7 @@
2007-03-09 Dirk Mueller <dmueller@suse.de>
- * cp/call.c (build_new_op): Call warn_logical_operator.
+ * call.c (build_new_op): Call warn_logical_operator.
2007-03-08 Volker Reichelt <reichelt@netcologne.de>
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index ccdcf379544..66e8f426b63 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4442,7 +4442,10 @@ layout_var_decl (tree decl)
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
else
- error ("storage size of %qD isn't constant", decl);
+ {
+ error ("storage size of %qD isn't constant", decl);
+ TREE_TYPE (decl) = error_mark_node;
+ }
}
}
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 2ffbd6f218a..a91f8d5f564 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -146,6 +146,7 @@ maybe_clone_body (tree fn)
TREE_PUBLIC (clone) = TREE_PUBLIC (fn);
DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn);
DECL_VISIBILITY_SPECIFIED (clone) = DECL_VISIBILITY_SPECIFIED (fn);
+ DECL_DLLIMPORT_P (clone) = DECL_DLLIMPORT_P (fn);
/* Adjust the parameter names and locations. */
parm = DECL_ARGUMENTS (fn);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d8ae286512a..bb7be99e7d2 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6161,13 +6161,22 @@ using twos complement arithmetic. When this option is in effect any
attempt to determine whether an operation on signed numbers will
overflow must be written carefully to not actually involve overflow.
+This option also allows the compiler to assume strict pointer
+semantics: given a pointer to an object, if adding an offset to that
+pointer does not produce a pointer to the same object, the addition is
+undefined. This permits the compiler to conclude that @code{p + u >
+p} is always true for a pointer @code{p} and unsigned integer
+@code{u}. This assumption is only valid because pointer wraparound is
+undefined, as the expression is false if @code{p + u} overflows using
+twos complement arithmetic.
+
See also the @option{-fwrapv} option. Using @option{-fwrapv} means
-that signed overflow is fully defined: it wraps. When
+that integer signed overflow is fully defined: it wraps. When
@option{-fwrapv} is used, there is no difference between
-@option{-fstrict-overflow} and @option{-fno-strict-overflow}. With
-@option{-fwrapv} certain types of overflow are permitted. For
-example, if the compiler gets an overflow when doing arithmetic on
-constants, the overflowed value can still be used with
+@option{-fstrict-overflow} and @option{-fno-strict-overflow} for
+integers. With @option{-fwrapv} certain types of overflow are
+permitted. For example, if the compiler gets an overflow when doing
+arithmetic on constants, the overflowed value can still be used with
@option{-fwrapv}, but not otherwise.
The @option{-fstrict-overflow} option is enabled at levels
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index 11903fe81a9..552bf170218 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -52,7 +52,8 @@ dw2_assemble_integer (int size, rtx x)
{
fputs (op, asm_out_file);
if (GET_CODE (x) == CONST_INT)
- fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, INTVAL (x));
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX,
+ (unsigned HOST_WIDE_INT) INTVAL (x));
else
output_addr_const (asm_out_file, x);
}
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2d8736de0fc..49c13d2afe4 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2116,7 +2116,8 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
dw2_asm_output_data (1, (cfi->dw_cfi_opc
| (cfi->dw_cfi_oprnd1.dw_cfi_offset & 0x3f)),
"DW_CFA_advance_loc " HOST_WIDE_INT_PRINT_HEX,
- cfi->dw_cfi_oprnd1.dw_cfi_offset);
+ ((unsigned HOST_WIDE_INT)
+ cfi->dw_cfi_oprnd1.dw_cfi_offset));
else if (cfi->dw_cfi_opc == DW_CFA_offset)
{
r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh);
diff --git a/gcc/except.c b/gcc/except.c
index 9c18ebde765..b1f233207e5 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -84,7 +84,6 @@ along with GCC; see the file COPYING3. If not see
#define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM
#endif
-
/* Protect cleanup actions with must-not-throw regions, with a call
to the given failure handler. */
tree (*lang_protect_cleanup_actions) (void);
@@ -218,37 +217,8 @@ struct eh_status GTY(())
/* The same information as an indexable array. */
VEC(eh_region,gc) *region_array;
-
- /* The most recently open region. */
- struct eh_region *cur_region;
-
- /* This is the region for which we are processing catch blocks. */
- struct eh_region *try_region;
-
- rtx filter;
- rtx exc_ptr;
-
- int built_landing_pads;
int last_region_number;
- VEC(tree,gc) *ttype_data;
- varray_type ehspec_data;
- varray_type action_record_data;
-
- htab_t GTY ((param_is (struct ehl_map_entry))) exception_handler_label_map;
-
- struct call_site_record * GTY ((length ("%h.call_site_data_used")))
- call_site_data;
- int call_site_data_used;
- int call_site_data_size;
-
- rtx ehr_stackadj;
- rtx ehr_handler;
- rtx ehr_label;
-
- rtx sjlj_fc;
- rtx sjlj_exit_after;
-
htab_t GTY((param_is (struct throw_stmt_node))) throw_stmt_table;
};
@@ -587,41 +557,27 @@ note_eh_region_may_contain_throw (struct eh_region *region)
}
}
-void
-note_current_region_may_contain_throw (void)
-{
- note_eh_region_may_contain_throw (cfun->eh->cur_region);
-}
-
/* Return an rtl expression for a pointer to the exception object
within a handler. */
rtx
-get_exception_pointer (struct function *fun)
+get_exception_pointer (void)
{
- rtx exc_ptr = fun->eh->exc_ptr;
- if (fun == cfun && ! exc_ptr)
- {
- exc_ptr = gen_reg_rtx (ptr_mode);
- fun->eh->exc_ptr = exc_ptr;
- }
- return exc_ptr;
+ if (! crtl->eh.exc_ptr)
+ crtl->eh.exc_ptr = gen_reg_rtx (ptr_mode);
+ return crtl->eh.exc_ptr;
}
/* Return an rtl expression for the exception dispatch filter
within a handler. */
rtx
-get_exception_filter (struct function *fun)
+get_exception_filter (void)
{
- rtx filter = fun->eh->filter;
- if (fun == cfun && ! filter)
- {
- filter = gen_reg_rtx (targetm.eh_return_filter_mode ());
- fun->eh->filter = filter;
- }
- return filter;
+ if (! crtl->eh.filter)
+ crtl->eh.filter = gen_reg_rtx (targetm.eh_return_filter_mode ());
+ return crtl->eh.filter;
}
/* This section is for the exception handling specific optimization pass. */
@@ -783,13 +739,13 @@ add_ehl_entry (rtx label, struct eh_region *region)
entry->region = region;
slot = (struct ehl_map_entry **)
- htab_find_slot (cfun->eh->exception_handler_label_map, entry, INSERT);
+ htab_find_slot (crtl->eh.exception_handler_label_map, entry, INSERT);
/* Before landing pad creation, each exception handler has its own
label. After landing pad creation, the exception handlers may
share landing pads. This is ok, since maybe_remove_eh_handler
only requires the 1-1 mapping before landing pad creation. */
- gcc_assert (!*slot || cfun->eh->built_landing_pads);
+ gcc_assert (!*slot || crtl->eh.built_landing_pads);
*slot = entry;
}
@@ -799,13 +755,13 @@ find_exception_handler_labels (void)
{
int i;
- if (cfun->eh->exception_handler_label_map)
- htab_empty (cfun->eh->exception_handler_label_map);
+ if (crtl->eh.exception_handler_label_map)
+ htab_empty (crtl->eh.exception_handler_label_map);
else
{
/* ??? The expansion factor here (3/2) must be greater than the htab
occupancy factor (4/3) to avoid unnecessary resizing. */
- cfun->eh->exception_handler_label_map
+ crtl->eh.exception_handler_label_map
= htab_create_ggc (cfun->eh->last_region_number * 3 / 2,
ehl_hash, ehl_eq, NULL);
}
@@ -821,7 +777,7 @@ find_exception_handler_labels (void)
region = VEC_index (eh_region, cfun->eh->region_array, i);
if (! region || region->region_number != i)
continue;
- if (cfun->eh->built_landing_pads)
+ if (crtl->eh.built_landing_pads)
lab = region->landing_pad;
else
lab = region->label;
@@ -832,7 +788,7 @@ find_exception_handler_labels (void)
/* For sjlj exceptions, need the return label to remain live until
after landing pad generation. */
- if (USING_SJLJ_EXCEPTIONS && ! cfun->eh->built_landing_pads)
+ if (USING_SJLJ_EXCEPTIONS && ! crtl->eh.built_landing_pads)
add_ehl_entry (return_label, NULL);
}
@@ -1227,7 +1183,7 @@ ehspec_filter_hash (const void *pentry)
return h;
}
-/* Add TYPE (which may be NULL) to cfun->eh->ttype_data, using TYPES_HASH
+/* Add TYPE (which may be NULL) to crtl->eh.ttype_data, using TYPES_HASH
to speed up the search. Return the filter value to be used. */
static int
@@ -1244,16 +1200,16 @@ add_ttypes_entry (htab_t ttypes_hash, tree type)
n = XNEW (struct ttypes_filter);
n->t = type;
- n->filter = VEC_length (tree, cfun->eh->ttype_data) + 1;
+ n->filter = VEC_length (tree, crtl->eh.ttype_data) + 1;
*slot = n;
- VEC_safe_push (tree, gc, cfun->eh->ttype_data, type);
+ VEC_safe_push (tree, gc, crtl->eh.ttype_data, type);
}
return n->filter;
}
-/* Add LIST to cfun->eh->ehspec_data, using EHSPEC_HASH and TYPES_HASH
+/* Add LIST to crtl->eh.ehspec_data, using EHSPEC_HASH and TYPES_HASH
to speed up the search. Return the filter value to be used. */
static int
@@ -1272,26 +1228,26 @@ add_ehspec_entry (htab_t ehspec_hash, htab_t ttypes_hash, tree list)
n = XNEW (struct ttypes_filter);
n->t = list;
- n->filter = -(VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) + 1);
+ n->filter = -(VARRAY_ACTIVE_SIZE (crtl->eh.ehspec_data) + 1);
*slot = n;
/* Generate a 0 terminated list of filter values. */
for (; list ; list = TREE_CHAIN (list))
{
if (targetm.arm_eabi_unwinder)
- VARRAY_PUSH_TREE (cfun->eh->ehspec_data, TREE_VALUE (list));
+ VARRAY_PUSH_TREE (crtl->eh.ehspec_data, TREE_VALUE (list));
else
{
/* Look up each type in the list and encode its filter
value as a uleb128. */
- push_uleb128 (&cfun->eh->ehspec_data,
+ push_uleb128 (&crtl->eh.ehspec_data,
add_ttypes_entry (ttypes_hash, TREE_VALUE (list)));
}
}
if (targetm.arm_eabi_unwinder)
- VARRAY_PUSH_TREE (cfun->eh->ehspec_data, NULL_TREE);
+ VARRAY_PUSH_TREE (crtl->eh.ehspec_data, NULL_TREE);
else
- VARRAY_PUSH_UCHAR (cfun->eh->ehspec_data, 0);
+ VARRAY_PUSH_UCHAR (crtl->eh.ehspec_data, 0);
}
return n->filter;
@@ -1308,11 +1264,11 @@ assign_filter_values (void)
int i;
htab_t ttypes, ehspec;
- cfun->eh->ttype_data = VEC_alloc (tree, gc, 16);
+ crtl->eh.ttype_data = VEC_alloc (tree, gc, 16);
if (targetm.arm_eabi_unwinder)
- VARRAY_TREE_INIT (cfun->eh->ehspec_data, 64, "ehspec_data");
+ VARRAY_TREE_INIT (crtl->eh.ehspec_data, 64, "ehspec_data");
else
- VARRAY_UCHAR_INIT (cfun->eh->ehspec_data, 64, "ehspec_data");
+ VARRAY_UCHAR_INIT (crtl->eh.ehspec_data, 64, "ehspec_data");
ttypes = htab_create (31, ttypes_filter_hash, ttypes_filter_eq, free);
ehspec = htab_create (31, ehspec_filter_hash, ehspec_filter_eq, free);
@@ -1457,7 +1413,7 @@ build_post_landing_pads (void)
for (; tp_node; )
{
emit_cmp_and_jump_insns
- (cfun->eh->filter,
+ (crtl->eh.filter,
GEN_INT (tree_low_cst (TREE_VALUE (flt_node), 0)),
EQ, NULL_RTX,
targetm.eh_return_filter_mode (), 0, c->label);
@@ -1490,7 +1446,7 @@ build_post_landing_pads (void)
emit_label (region->post_landing_pad);
- emit_cmp_and_jump_insns (cfun->eh->filter,
+ emit_cmp_and_jump_insns (crtl->eh.filter,
GEN_INT (region->u.allowed.filter),
EQ, NULL_RTX,
targetm.eh_return_filter_mode (), 0, region->label);
@@ -1573,7 +1529,7 @@ connect_post_landing_pads (void)
else
{
emit_library_call (unwind_resume_libfunc, LCT_THROW,
- VOIDmode, 1, cfun->eh->exc_ptr, ptr_mode);
+ VOIDmode, 1, crtl->eh.exc_ptr, ptr_mode);
/* What we just emitted was a throwing libcall, so it got a
barrier automatically added after it. If the last insn in
@@ -1643,9 +1599,9 @@ dw2_build_landing_pads (void)
#endif
{ /* Nothing */ }
- emit_move_insn (cfun->eh->exc_ptr,
+ emit_move_insn (crtl->eh.exc_ptr,
gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0)));
- emit_move_insn (cfun->eh->filter,
+ emit_move_insn (crtl->eh.filter,
gen_rtx_REG (targetm.eh_return_filter_mode (),
EH_RETURN_DATA_REGNO (1)));
@@ -1724,7 +1680,7 @@ sjlj_assign_call_site_values (rtx dispatch_label, struct sjlj_lp_info *lp_info)
/* First task: build the action table. */
- VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data");
+ VARRAY_UCHAR_INIT (crtl->eh.action_record_data, 64, "action_record_data");
ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
for (i = cfun->eh->last_region_number; i > 0; --i)
@@ -1830,7 +1786,7 @@ sjlj_mark_call_sites (struct sjlj_lp_info *lp_info)
before = find_first_parameter_load (insn, NULL_RTX);
start_sequence ();
- mem = adjust_address (cfun->eh->sjlj_fc, TYPE_MODE (integer_type_node),
+ mem = adjust_address (crtl->eh.sjlj_fc, TYPE_MODE (integer_type_node),
sjlj_fc_call_site_ofs);
emit_move_insn (mem, GEN_INT (this_call_site));
p = get_insns ();
@@ -1849,7 +1805,7 @@ sjlj_emit_function_enter (rtx dispatch_label)
rtx fn_begin, fc, mem, seq;
bool fn_begin_outside_block;
- fc = cfun->eh->sjlj_fc;
+ fc = crtl->eh.sjlj_fc;
start_sequence ();
@@ -1923,7 +1879,7 @@ sjlj_emit_function_enter (rtx dispatch_label)
void
sjlj_emit_function_exit_after (rtx after)
{
- cfun->eh->sjlj_exit_after = after;
+ crtl->eh.sjlj_exit_after = after;
}
static void
@@ -1936,7 +1892,7 @@ sjlj_emit_function_exit (void)
start_sequence ();
emit_library_call (unwind_sjlj_unregister_libfunc, LCT_NORMAL, VOIDmode,
- 1, XEXP (cfun->eh->sjlj_fc, 0), Pmode);
+ 1, XEXP (crtl->eh.sjlj_fc, 0), Pmode);
seq = get_insns ();
end_sequence ();
@@ -1958,7 +1914,7 @@ sjlj_emit_function_exit (void)
gcc_assert (e->src->next_bb == EXIT_BLOCK_PTR);
for (insn = BB_HEAD (e->src); ; insn = NEXT_INSN (insn))
{
- if (insn == cfun->eh->sjlj_exit_after)
+ if (insn == crtl->eh.sjlj_exit_after)
{
if (LABEL_P (insn))
insn = NEXT_INSN (insn);
@@ -1981,7 +1937,7 @@ sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info)
basic_block bb;
edge e;
- fc = cfun->eh->sjlj_fc;
+ fc = crtl->eh.sjlj_fc;
start_sequence ();
@@ -2006,10 +1962,10 @@ sjlj_emit_dispatch_table (rtx dispatch_label, struct sjlj_lp_info *lp_info)
mem = convert_to_mode (ptr_mode, mem, 0);
#endif
}
- emit_move_insn (cfun->eh->exc_ptr, mem);
+ emit_move_insn (crtl->eh.exc_ptr, mem);
mem = adjust_address (fc, word_mode, sjlj_fc_data_ofs + UNITS_PER_WORD);
- emit_move_insn (cfun->eh->filter, mem);
+ emit_move_insn (crtl->eh.filter, mem);
/* Jump to one of the directly reachable regions. */
/* ??? This really ought to be using a switch statement. */
@@ -2055,7 +2011,7 @@ sjlj_build_landing_pads (void)
{
rtx dispatch_label = gen_label_rtx ();
- cfun->eh->sjlj_fc
+ crtl->eh.sjlj_fc
= assign_stack_local (TYPE_MODE (sjlj_fc_type_node),
int_size_in_bytes (sjlj_fc_type_node),
TYPE_ALIGN (sjlj_fc_type_node));
@@ -2091,8 +2047,8 @@ finish_eh_generation (void)
/* These registers are used by the landing pads. Make sure they
have been generated. */
- get_exception_pointer (cfun);
- get_exception_filter (cfun);
+ get_exception_pointer ();
+ get_exception_filter ();
/* Construct the landing pads. */
@@ -2104,7 +2060,7 @@ finish_eh_generation (void)
else
dw2_build_landing_pads ();
- cfun->eh->built_landing_pads = 1;
+ crtl->eh.built_landing_pads = 1;
/* We've totally changed the CFG. Start over. */
find_exception_handler_labels ();
@@ -2166,15 +2122,15 @@ remove_exception_handler_label (rtx label)
/* If exception_handler_label_map was not built yet,
there is nothing to do. */
- if (cfun->eh->exception_handler_label_map == NULL)
+ if (crtl->eh.exception_handler_label_map == NULL)
return;
tmp.label = label;
slot = (struct ehl_map_entry **)
- htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
+ htab_find_slot (crtl->eh.exception_handler_label_map, &tmp, NO_INSERT);
gcc_assert (slot);
- htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
+ htab_clear_slot (crtl->eh.exception_handler_label_map, (void **) slot);
}
/* Splice REGION from the region tree etc. */
@@ -2213,7 +2169,7 @@ remove_eh_handler (struct eh_region *region)
bitmap_set_bit (outer->aka, region->region_number);
}
- if (cfun->eh->built_landing_pads)
+ if (crtl->eh.built_landing_pads)
lab = region->landing_pad;
else
lab = region->label;
@@ -2281,12 +2237,12 @@ maybe_remove_eh_handler (rtx label)
if the region data is completely unused. One must examine the
landing pad and the post landing pad, and whether an inner try block
is referencing the catch handlers directly. */
- if (cfun->eh->built_landing_pads)
+ if (crtl->eh.built_landing_pads)
return;
tmp.label = label;
slot = (struct ehl_map_entry **)
- htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
+ htab_find_slot (crtl->eh.exception_handler_label_map, &tmp, NO_INSERT);
if (! slot)
return;
region = (*slot)->region;
@@ -2299,7 +2255,7 @@ maybe_remove_eh_handler (rtx label)
are no more contained calls, which we don't see here. */
if (region->type == ERT_MUST_NOT_THROW)
{
- htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
+ htab_clear_slot (crtl->eh.exception_handler_label_map, (void **) slot);
region->label = NULL_RTX;
}
else
@@ -2312,7 +2268,7 @@ maybe_remove_eh_handler (rtx label)
void
for_each_eh_label (void (*callback) (rtx))
{
- htab_traverse (cfun->eh->exception_handler_label_map, for_each_eh_label_1,
+ htab_traverse (crtl->eh.exception_handler_label_map, for_each_eh_label_1,
(void *) &callback);
}
@@ -2396,7 +2352,7 @@ add_reachable_handler (struct reachable_info *info,
info->saw_any_handlers = true;
- if (cfun->eh->built_landing_pads)
+ if (crtl->eh.built_landing_pads)
info->callback (lp_region, info->callback_data);
else
info->callback (region, info->callback_data);
@@ -2658,7 +2614,7 @@ reachable_handlers (rtx insn)
}
foreach_reachable_handler (region_number, is_resx,
- (cfun->eh->built_landing_pads
+ (crtl->eh.built_landing_pads
? arh_to_landing_pad
: arh_to_label),
&handlers);
@@ -2966,26 +2922,26 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
rtx tmp;
#ifdef EH_RETURN_STACKADJ_RTX
- tmp = expand_expr (stackadj_tree, cfun->eh->ehr_stackadj,
+ tmp = expand_expr (stackadj_tree, crtl->eh.ehr_stackadj,
VOIDmode, EXPAND_NORMAL);
tmp = convert_memory_address (Pmode, tmp);
- if (!cfun->eh->ehr_stackadj)
- cfun->eh->ehr_stackadj = copy_to_reg (tmp);
- else if (tmp != cfun->eh->ehr_stackadj)
- emit_move_insn (cfun->eh->ehr_stackadj, tmp);
+ if (!crtl->eh.ehr_stackadj)
+ crtl->eh.ehr_stackadj = copy_to_reg (tmp);
+ else if (tmp != crtl->eh.ehr_stackadj)
+ emit_move_insn (crtl->eh.ehr_stackadj, tmp);
#endif
- tmp = expand_expr (handler_tree, cfun->eh->ehr_handler,
+ tmp = expand_expr (handler_tree, crtl->eh.ehr_handler,
VOIDmode, EXPAND_NORMAL);
tmp = convert_memory_address (Pmode, tmp);
- if (!cfun->eh->ehr_handler)
- cfun->eh->ehr_handler = copy_to_reg (tmp);
- else if (tmp != cfun->eh->ehr_handler)
- emit_move_insn (cfun->eh->ehr_handler, tmp);
+ if (!crtl->eh.ehr_handler)
+ crtl->eh.ehr_handler = copy_to_reg (tmp);
+ else if (tmp != crtl->eh.ehr_handler)
+ emit_move_insn (crtl->eh.ehr_handler, tmp);
- if (!cfun->eh->ehr_label)
- cfun->eh->ehr_label = gen_label_rtx ();
- emit_jump (cfun->eh->ehr_label);
+ if (!crtl->eh.ehr_label)
+ crtl->eh.ehr_label = gen_label_rtx ();
+ emit_jump (crtl->eh.ehr_label);
}
void
@@ -2993,7 +2949,7 @@ expand_eh_return (void)
{
rtx around_label;
- if (! cfun->eh->ehr_label)
+ if (! crtl->eh.ehr_label)
return;
current_function_calls_eh_return = 1;
@@ -3005,21 +2961,21 @@ expand_eh_return (void)
around_label = gen_label_rtx ();
emit_jump (around_label);
- emit_label (cfun->eh->ehr_label);
+ emit_label (crtl->eh.ehr_label);
clobber_return_register ();
#ifdef EH_RETURN_STACKADJ_RTX
- emit_move_insn (EH_RETURN_STACKADJ_RTX, cfun->eh->ehr_stackadj);
+ emit_move_insn (EH_RETURN_STACKADJ_RTX, crtl->eh.ehr_stackadj);
#endif
#ifdef HAVE_eh_return
if (HAVE_eh_return)
- emit_insn (gen_eh_return (cfun->eh->ehr_handler));
+ emit_insn (gen_eh_return (crtl->eh.ehr_handler));
else
#endif
{
#ifdef EH_RETURN_HANDLER_RTX
- emit_move_insn (EH_RETURN_HANDLER_RTX, cfun->eh->ehr_handler);
+ emit_move_insn (EH_RETURN_HANDLER_RTX, crtl->eh.ehr_handler);
#else
error ("__builtin_eh_return not supported on this target");
#endif
@@ -3093,7 +3049,7 @@ add_action_record (htab_t ar_hash, int filter, int next)
if ((new = *slot) == NULL)
{
new = xmalloc (sizeof (*new));
- new->offset = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
+ new->offset = VARRAY_ACTIVE_SIZE (crtl->eh.action_record_data) + 1;
new->filter = filter;
new->next = next;
*slot = new;
@@ -3103,10 +3059,10 @@ add_action_record (htab_t ar_hash, int filter, int next)
that there is no next record. So convert the absolute 1 based
indices we've been carrying around into a displacement. */
- push_sleb128 (&cfun->eh->action_record_data, filter);
+ push_sleb128 (&crtl->eh.action_record_data, filter);
if (next)
- next -= VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
- push_sleb128 (&cfun->eh->action_record_data, next);
+ next -= VARRAY_ACTIVE_SIZE (crtl->eh.action_record_data) + 1;
+ push_sleb128 (&crtl->eh.action_record_data, next);
}
return new->offset;
@@ -3226,24 +3182,15 @@ collect_one_action_chain (htab_t ar_hash, struct eh_region *region)
static int
add_call_site (rtx landing_pad, int action)
{
- struct call_site_record *data = cfun->eh->call_site_data;
- int used = cfun->eh->call_site_data_used;
- int size = cfun->eh->call_site_data_size;
+ call_site_record record;
+
+ record = ggc_alloc (sizeof (struct call_site_record));
+ record->landing_pad = landing_pad;
+ record->action = action;
- if (used >= size)
- {
- size = (size ? size * 2 : 64);
- data = ggc_realloc (data, sizeof (*data) * size);
- cfun->eh->call_site_data = data;
- cfun->eh->call_site_data_size = size;
- }
+ VEC_safe_push (call_site_record, gc, crtl->eh.call_site_record, record);
- data[used].landing_pad = landing_pad;
- data[used].action = action;
-
- cfun->eh->call_site_data_used = used + 1;
-
- return used + call_site_base;
+ return call_site_base + VEC_length (call_site_record, crtl->eh.call_site_record) - 1;
}
/* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
@@ -3264,7 +3211,7 @@ convert_to_eh_region_ranges (void)
if (USING_SJLJ_EXCEPTIONS || cfun->eh->region_tree == NULL)
return 0;
- VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data");
+ VARRAY_UCHAR_INIT (crtl->eh.action_record_data, 64, "action_record_data");
ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
@@ -3466,12 +3413,12 @@ sjlj_size_of_call_site_table (void)
static void
dw2_output_call_site_table (void)
{
- int n = cfun->eh->call_site_data_used;
+ int n = VEC_length (call_site_record, crtl->eh.call_site_record);
int i;
for (i = 0; i < n; ++i)
{
- struct call_site_record *cs = &cfun->eh->call_site_data[i];
+ struct call_site_record *cs = VEC_index (call_site_record, crtl->eh.call_site_record, i);
char reg_start_lab[32];
char reg_end_lab[32];
char landing_pad_lab[32];
@@ -3520,12 +3467,12 @@ dw2_output_call_site_table (void)
static void
sjlj_output_call_site_table (void)
{
- int n = cfun->eh->call_site_data_used;
+ int n = VEC_length (call_site_record, crtl->eh.call_site_record);
int i;
for (i = 0; i < n; ++i)
{
- struct call_site_record *cs = &cfun->eh->call_site_data[i];
+ struct call_site_record *cs = VEC_index (call_site_record, crtl->eh.call_site_record, i);
dw2_asm_output_data_uleb128 (INTVAL (cs->landing_pad),
"region %d landing pad", i);
@@ -3672,8 +3619,8 @@ output_function_exception_table (const char * ARG_UNUSED (fnname))
/* If the target wants a label to begin the table, emit it here. */
targetm.asm_out.except_table_label (asm_out_file);
- have_tt_data = (VEC_length (tree, cfun->eh->ttype_data) > 0
- || VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) > 0);
+ have_tt_data = (VEC_length (tree, crtl->eh.ttype_data) > 0
+ || VARRAY_ACTIVE_SIZE (crtl->eh.ehspec_data) > 0);
/* Indicate the format of the @TType entries. */
if (! have_tt_data)
@@ -3734,8 +3681,8 @@ output_function_exception_table (const char * ARG_UNUSED (fnname))
before_disp = 1 + 1;
after_disp = (1 + size_of_uleb128 (call_site_len)
+ call_site_len
- + VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data)
- + (VEC_length (tree, cfun->eh->ttype_data)
+ + VARRAY_ACTIVE_SIZE (crtl->eh.action_record_data)
+ + (VEC_length (tree, crtl->eh.ttype_data)
* tt_format_size));
disp = after_disp;
@@ -3789,18 +3736,18 @@ output_function_exception_table (const char * ARG_UNUSED (fnname))
#endif
/* ??? Decode and interpret the data for flag_debug_asm. */
- n = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data);
+ n = VARRAY_ACTIVE_SIZE (crtl->eh.action_record_data);
for (i = 0; i < n; ++i)
- dw2_asm_output_data (1, VARRAY_UCHAR (cfun->eh->action_record_data, i),
+ dw2_asm_output_data (1, VARRAY_UCHAR (crtl->eh.action_record_data, i),
(i ? NULL : "Action record table"));
if (have_tt_data)
assemble_align (tt_format_size * BITS_PER_UNIT);
- i = VEC_length (tree, cfun->eh->ttype_data);
+ i = VEC_length (tree, crtl->eh.ttype_data);
while (i-- > 0)
{
- tree type = VEC_index (tree, cfun->eh->ttype_data, i);
+ tree type = VEC_index (tree, crtl->eh.ttype_data, i);
output_ttype (type, tt_format, tt_format_size);
}
@@ -3810,16 +3757,16 @@ output_function_exception_table (const char * ARG_UNUSED (fnname))
#endif
/* ??? Decode and interpret the data for flag_debug_asm. */
- n = VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data);
+ n = VARRAY_ACTIVE_SIZE (crtl->eh.ehspec_data);
for (i = 0; i < n; ++i)
{
if (targetm.arm_eabi_unwinder)
{
- tree type = VARRAY_TREE (cfun->eh->ehspec_data, i);
+ tree type = VARRAY_TREE (crtl->eh.ehspec_data, i);
output_ttype (type, tt_format, tt_format_size);
}
else
- dw2_asm_output_data (1, VARRAY_UCHAR (cfun->eh->ehspec_data, i),
+ dw2_asm_output_data (1, VARRAY_UCHAR (crtl->eh.ehspec_data, i),
(i ? NULL : "Exception specification table"));
}
diff --git a/gcc/except.h b/gcc/except.h
index 3fb33809d85..ba6f5929dd2 100644
--- a/gcc/except.h
+++ b/gcc/except.h
@@ -35,7 +35,6 @@ extern int doing_eh (int);
/* Note that the current EH region (if any) may contain a throw, or a
call to a function which itself may contain a throw. */
extern void note_eh_region_may_contain_throw (struct eh_region *);
-extern void note_current_region_may_contain_throw (void);
/* Invokes CALLBACK for every exception handler label. Only used by old
loop hackery; should not be used by new code. */
@@ -78,8 +77,8 @@ extern rtx expand_builtin_dwarf_sp_column (void);
extern void expand_builtin_eh_return (tree, tree);
extern void expand_eh_return (void);
extern rtx expand_builtin_extend_pointer (tree);
-extern rtx get_exception_pointer (struct function *);
-extern rtx get_exception_filter (struct function *);
+extern rtx get_exception_pointer (void);
+extern rtx get_exception_filter (void);
typedef tree (*duplicate_eh_regions_map) (tree, void *);
extern int duplicate_eh_regions (struct function *, duplicate_eh_regions_map,
void *, int, int);
diff --git a/gcc/expr.c b/gcc/expr.c
index 98f7c1d8ecd..71b356be2bd 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9180,10 +9180,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return const0_rtx;
case EXC_PTR_EXPR:
- return get_exception_pointer (cfun);
+ return get_exception_pointer ();
case FILTER_EXPR:
- return get_exception_filter (cfun);
+ return get_exception_filter ();
case FDESC_EXPR:
/* Function descriptors are not valid except for as
diff --git a/gcc/final.c b/gcc/final.c
index 98166247925..6d861c76e62 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -3416,9 +3416,11 @@ output_addr_const (FILE *file, rtx x)
/* We can use %d if the number is one word and positive. */
if (CONST_DOUBLE_HIGH (x))
fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- CONST_DOUBLE_HIGH (x), CONST_DOUBLE_LOW (x));
+ (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (x),
+ (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x));
else if (CONST_DOUBLE_LOW (x) < 0)
- fprintf (file, HOST_WIDE_INT_PRINT_HEX, CONST_DOUBLE_LOW (x));
+ fprintf (file, HOST_WIDE_INT_PRINT_HEX,
+ (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x));
else
fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x));
}
@@ -3429,7 +3431,8 @@ output_addr_const (FILE *file, rtx x)
break;
case CONST_FIXED:
- fprintf (file, HOST_WIDE_INT_PRINT_HEX, CONST_FIXED_VALUE_LOW (x));
+ fprintf (file, HOST_WIDE_INT_PRINT_HEX,
+ (unsigned HOST_WIDE_INT) CONST_FIXED_VALUE_LOW (x));
break;
case PLUS:
diff --git a/gcc/flags.h b/gcc/flags.h
index 686691c21e0..e7596957d82 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -332,6 +332,9 @@ extern bool flag_instrument_functions_exclude_p (tree fndecl);
#define TYPE_OVERFLOW_TRAPS(TYPE) \
(!TYPE_UNSIGNED (TYPE) && flag_trapv)
+/* True if pointer types have undefined overflow. */
+#define POINTER_TYPE_OVERFLOW_UNDEFINED (flag_strict_overflow)
+
/* Names for the different levels of -Wstrict-overflow=N. The numeric
values here correspond to N. */
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 66e72a7d0ad..c1451789af0 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1012,7 +1012,6 @@ fold_deferring_overflow_warnings_p (void)
static void
fold_overflow_warning (const char* gmsgid, enum warn_strict_overflow_code wc)
{
- gcc_assert (!flag_wrapv && !flag_trapv);
if (fold_deferring_overflow_warnings > 0)
{
if (fold_deferred_overflow_warning == NULL
@@ -8568,7 +8567,9 @@ fold_comparison (enum tree_code code, tree type, tree op0, tree op1)
because pointer arithmetic is restricted to retain within an
object and overflow on pointer differences is undefined as of
6.5.6/8 and /9 with respect to the signed ptrdiff_t. */
- else if (bitpos0 == bitpos1)
+ else if (bitpos0 == bitpos1
+ && ((code == EQ_EXPR || code == NE_EXPR)
+ || POINTER_TYPE_OVERFLOW_UNDEFINED))
{
tree signed_size_type_node;
signed_size_type_node = signed_type_for (size_type_node);
@@ -8587,6 +8588,12 @@ fold_comparison (enum tree_code code, tree type, tree op0, tree op1)
else
offset1 = fold_convert (signed_size_type_node, offset1);
+ if (code != EQ_EXPR && code != NE_EXPR)
+ fold_overflow_warning (("assuming pointer wraparound does not "
+ "occur when comparing P +- C1 with "
+ "P +- C2"),
+ WARN_STRICT_OVERFLOW_COMPARISON);
+
return fold_build2 (code, type, offset0, offset1);
}
}
@@ -9711,7 +9718,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
/* With undefined overflow we can only associate constants
with one variable. */
- if ((POINTER_TYPE_P (type)
+ if (((POINTER_TYPE_P (type) && POINTER_TYPE_OVERFLOW_UNDEFINED)
|| (INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_WRAPS (type)))
&& var0 && var1)
{
@@ -14096,12 +14103,9 @@ tree_call_nonnegative_warnv_p (enum tree_code code, tree type, tree fndecl,
CASE_FLT_FN (BUILT_IN_POWI):
/* True if the 1st argument is nonnegative or the second
argument is an even integer. */
- if (TREE_CODE (arg1) == INTEGER_CST)
- {
- tree arg1 = arg1;
- if ((TREE_INT_CST_LOW (arg1) & 1) == 0)
- return true;
- }
+ if (TREE_CODE (arg1) == INTEGER_CST
+ && (TREE_INT_CST_LOW (arg1) & 1) == 0)
+ return true;
return tree_expr_nonnegative_warnv_p (arg0,
strict_overflow_p);
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a282623da15..f7ed06b3708 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,16 @@
+2008-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/35662
+ * f95-lang.c (gfc_init_builtin_functions): Make sure
+ BUILT_IN_SINCOS{,F,L} types aren't varargs.
+
+2008-04-15 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/35864
+ * expr.c (scalarize_intrinsic_call): Reorder identification of
+ array argument so that if one is not found a segfault does not
+ occur. Return FAILURE if all scalar arguments.
+
2008-04-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 12e88a07420..70914c14aab 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1704,14 +1704,11 @@ scalarize_intrinsic_call (gfc_expr *e)
gfc_expr *expr, *old;
int n, i, rank[5], array_arg;
- old = gfc_copy_expr (e);
-
-
/* Find which, if any, arguments are arrays. Assume that the old
expression carries the type information and that the first arg
that is an array expression carries all the shape information.*/
n = array_arg = 0;
- a = old->value.function.actual;
+ a = e->value.function.actual;
for (; a; a = a->next)
{
n++;
@@ -1723,7 +1720,9 @@ scalarize_intrinsic_call (gfc_expr *e)
}
if (!array_arg)
- goto cleanup;
+ return FAILURE;
+
+ old = gfc_copy_expr (e);
gfc_free_constructor (expr->value.constructor);
expr->value.constructor = NULL;
@@ -1763,7 +1762,7 @@ scalarize_intrinsic_call (gfc_expr *e)
}
- /* Using the first argument as the master, step through the array
+ /* Using the array argument as the master, step through the array
calling the function for each element and advancing the array
constructors together. */
ctor = args[array_arg - 1];
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index eacaff82ab0..4d2e9783af7 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -848,21 +848,21 @@ gfc_init_builtin_functions (void)
ptype = build_pointer_type (float_type_node);
tmp = tree_cons (NULL_TREE, float_type_node,
tree_cons (NULL_TREE, ptype,
- build_tree_list (NULL_TREE, ptype)));
+ tree_cons (NULL_TREE, ptype, void_list_node)));
func_float_floatp_floatp =
build_function_type (void_type_node, tmp);
ptype = build_pointer_type (double_type_node);
tmp = tree_cons (NULL_TREE, double_type_node,
tree_cons (NULL_TREE, ptype,
- build_tree_list (NULL_TREE, ptype)));
+ tree_cons (NULL_TREE, ptype, void_list_node)));
func_double_doublep_doublep =
build_function_type (void_type_node, tmp);
ptype = build_pointer_type (long_double_type_node);
tmp = tree_cons (NULL_TREE, long_double_type_node,
tree_cons (NULL_TREE, ptype,
- build_tree_list (NULL_TREE, ptype)));
+ tree_cons (NULL_TREE, ptype, void_list_node)));
func_longdouble_longdoublep_longdoublep =
build_function_type (void_type_node, tmp);
diff --git a/gcc/function.h b/gcc/function.h
index edc7216e751..1fe6d6a51ea 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "hashtab.h"
+#include "varray.h"
/* Stack of pending (incomplete) sequences saved by `start_sequence'.
Each element describes one pending sequence.
@@ -136,6 +137,34 @@ struct expr_status GTY(())
rtx x_forced_labels;
};
+typedef struct call_site_record *call_site_record;
+DEF_VEC_P(call_site_record);
+DEF_VEC_ALLOC_P(call_site_record, gc);
+
+/* RTL representation of exception handling. */
+struct rtl_eh GTY(())
+{
+ rtx filter;
+ rtx exc_ptr;
+
+ int built_landing_pads;
+
+ rtx ehr_stackadj;
+ rtx ehr_handler;
+ rtx ehr_label;
+
+ rtx sjlj_fc;
+ rtx sjlj_exit_after;
+
+ htab_t GTY ((param_is (struct ehl_map_entry))) exception_handler_label_map;
+
+ VEC(tree,gc) *ttype_data;
+ varray_type ehspec_data;
+ varray_type action_record_data;
+
+ VEC(call_site_record,gc) *call_site_record;
+};
+
#define pending_stack_adjust (crtl->expr.x_pending_stack_adjust)
#define inhibit_defer_pop (crtl->expr.x_inhibit_defer_pop)
#define saveregs_value (crtl->expr.x_saveregs_value)
@@ -146,6 +175,7 @@ struct expr_status GTY(())
struct gimple_df;
struct temp_slot;
typedef struct temp_slot *temp_slot_p;
+struct call_site_record;
DEF_VEC_P(temp_slot_p);
DEF_VEC_ALLOC_P(temp_slot_p,gc);
@@ -227,6 +257,7 @@ struct rtl_data GTY(())
struct varasm_status varasm;
struct incoming_args args;
struct function_subsections subsections;
+ struct rtl_eh eh;
/* For function.c */
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 50131aafea1..d2a1160f7af 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -2984,6 +2984,8 @@ write_root (outf_p f, pair_p v, type_p type, const char *name, int has_length,
skip_p = 1;
else if (strcmp (o->name, "desc") == 0)
desc = o->info;
+ else if (strcmp (o->name, "param_is") == 0)
+ ;
else
error_at_line (line,
"field `%s' of global `%s' has unknown option `%s'",
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index ec1f81008bd..f8e442d8537 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -2058,10 +2058,6 @@ getpagesize (void)
#endif
}
-#ifdef __i386__
-extern int VirtualProtect (char *, int, int, int *) __attribute__((stdcall));
-#endif
-
int
mprotect (char *addr, int len, int prot)
{
diff --git a/gcc/params.def b/gcc/params.def
index c7a0513e136..6936aee12f7 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -652,7 +652,7 @@ DEFPARAM (PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS,
DEFPARAM (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE,
"max-fields-for-field-sensitive",
"Maximum number of fields in a structure before pointer analysis treats the structure as a single variable",
- 100, 0, 0)
+ 0, 0, 0)
DEFPARAM(PARAM_MAX_SCHED_READY_INSNS,
"max-sched-ready-insns",
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index d77645573f3..2e96bb4d80a 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -384,7 +384,7 @@ print_rtx (const_rtx in_rtx)
fprintf (outfile, HOST_WIDE_INT_PRINT_DEC, XWINT (in_rtx, i));
if (! flag_simple)
fprintf (outfile, " [" HOST_WIDE_INT_PRINT_HEX "]",
- XWINT (in_rtx, i));
+ (unsigned HOST_WIDE_INT) XWINT (in_rtx, i));
break;
case 'i':
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index f7097a415d4..78fd72ec7c5 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -127,7 +127,8 @@ print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
-TREE_INT_CST_LOW (node));
else
fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node));
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node),
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node));
}
if (TREE_CODE (node) == REAL_CST)
{
@@ -741,7 +742,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
-TREE_INT_CST_LOW (node));
else
fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node));
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node),
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node));
break;
case REAL_CST:
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 8f4597247e5..242791ba9e1 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -434,7 +434,8 @@ print_value (char *buf, const_rtx x, int verbose)
switch (GET_CODE (x))
{
case CONST_INT:
- sprintf (t, HOST_WIDE_INT_PRINT_HEX, INTVAL (x));
+ sprintf (t, HOST_WIDE_INT_PRINT_HEX,
+ (unsigned HOST_WIDE_INT) INTVAL (x));
cur = safe_concat (buf, cur, t);
break;
case CONST_DOUBLE:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8af67f7b0b7..6f60dc33c7d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,86 @@
+2008-04-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR target/35944
+ * gfortran.dg/pr35944-1.f90: New test.
+ * gfortran.dg/pr35944-2.f90: Ditto.
+
+2008-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35739
+ * gcc.dg/dfp/pr35739.c: New test.
+
+ PR tree-optimization/35899
+ * gcc.dg/pr35899.c: New test.
+
+ PR target/35662
+ * gfortran.dg/pr35662.f90: New test.
+
+2008-04-16 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/loop-35.c: New testcase.
+
+2008-04-16 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/29015
+ * gnat.dg/incomplete1.ads, gnat.dg/incomplete2.ads,
+ gnat.dg/incomplete2.adb: New.
+
+2008-04-16 Hans-Peter Nilsson <hp@axis.com>
+
+ PR tree-optimization/35629
+ * gcc.dg/tree-ssa/loop-25.c: Xfail all but the first
+ scan-tree-dump-times.
+
+2008-04-15 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/22387
+ * gnat.dg/specs/corr_discr.ads: New.
+
+2008-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/string_slice2.adb: New test.
+
+2008-04-15 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/fold-compare-2.c: Adjust testcase.
+ * gcc.dg/tree-ssa/pr21086.c: Likewise.
+
+2008-04-15 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/salias-1.c: Remove.
+ * gcc.dg/tree-ssa/pr26421.c: Adjust pattern.
+ * gcc.dg/tree-ssa/alias-15.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-lim-3.c: Run at -O2.
+
+2008-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/loop_optimization1.ad[sb]: New test.
+
+2008-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35751
+ * gcc.dg/gomp/pr35751.c: New test.
+ * g++.dg/gomp/pr35751.C: New test.
+
+2008-04-15 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/16086
+ * gnat.dg/prot_def.adb: New.
+
+2008-04-14 Ian Lance Taylor <iant@google.com>
+
+ * gcc.dg/strict-overflow-6.c: New.
+ * gcc.dg/no-strict-overflow-7.c: New.
+ * gcc.dg/Wstrict-overflow-22.c: New.
+
+2008-04-14 Samuel Tardieu <sam@rfc1149.net>
+
+ * gnat.dg/specs/storage.ads: Fix expected error message.
+
+2008-04-14 Robert Dewar <dewar@adacore.com>
+
+ * gnat.dg/specs/linker_section.ads: Check for more error conditions.
+
2008-04-14 Samuel Tardieu <sam@rfc1149.net>
PR ada/18680
@@ -135,7 +218,7 @@
* gfortran.dg/bind_c_usage_14.f03: Adjust.
-2008-04-08 Andy Hutchinson <hutchinsonandy@aim.com>
+2008-04-08 Andy Hutchinson <hutchinsonandy@aim.com>
PR target/35005
* execute/20071221-1.c: Adapt test for 16 bit int targets.
@@ -173,7 +256,7 @@
2008-04-07 Kai Tietz <kai.tietz@onevision.com>
PR/35842
- * gcc.dg/torture/pr35842.c: New.
+ * gcc.dg/torture/pr35842.c: New.
2008-04-07 Eric Botcazou <ebotcazou@adacore.com>
@@ -1439,7 +1522,7 @@
2008-02-29 Sebastian Pop <sebastian.pop@amd.com>
- * testsuite/gcc.dg/tree-ssa/ltrans-8.c: Increase the size of strides
+ * gcc.dg/tree-ssa/ltrans-8.c: Increase the size of strides
to make the interchange profitable.
2008-02-28 Daniel Franke <franke.daniel@gmail.com>
@@ -1462,20 +1545,20 @@
2008-02-28 Sebastian Pop <sebastian.pop@amd.com>
- * testsuite/gcc.dg/tree-ssa/ldist-1.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-1a.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-2.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-3.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-4.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-5.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-6.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-7.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-8.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-9.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-10.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-11.c: New.
- * testsuite/gcc.dg/tree-ssa/ldist-12.c: New.
- * testsuite/gfortran.dg/ldist-1.f90: New.
+ * gcc.dg/tree-ssa/ldist-1.c: New.
+ * gcc.dg/tree-ssa/ldist-1a.c: New.
+ * gcc.dg/tree-ssa/ldist-2.c: New.
+ * gcc.dg/tree-ssa/ldist-3.c: New.
+ * gcc.dg/tree-ssa/ldist-4.c: New.
+ * gcc.dg/tree-ssa/ldist-5.c: New.
+ * gcc.dg/tree-ssa/ldist-6.c: New.
+ * gcc.dg/tree-ssa/ldist-7.c: New.
+ * gcc.dg/tree-ssa/ldist-8.c: New.
+ * gcc.dg/tree-ssa/ldist-9.c: New.
+ * gcc.dg/tree-ssa/ldist-10.c: New.
+ * gcc.dg/tree-ssa/ldist-11.c: New.
+ * gcc.dg/tree-ssa/ldist-12.c: New.
+ * gfortran.dg/ldist-1.f90: New.
2008-02-28 Uros Bizjak <ubizjak@gmail.com>
@@ -1955,7 +2038,7 @@
2008-02-15 Dominique d'Humieres <dominiq@lps.ens.fr>
PR testsuite/35119
- * testsuite/g++.dg/template/spec35.C: Change the regular expressions
+ * g++.dg/template/spec35.C: Change the regular expressions
in dg-final to match the assembly code generated by Darwin 9.
2008-02-15 Uros Bizjak <ubizjak@gmail.com>
@@ -2163,7 +2246,7 @@
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00110.html
PR 33738
- * testsuite/g++.dg/warn/pr33738.C: New.
+ * g++.dg/warn/pr33738.C: New.
2008-02-04 Daniel Franke <franke.daniel@gmail.com>
@@ -2748,7 +2831,7 @@
2008-01-18 Jonathan Wakely <jwakely.gcc@gmail.com>
- * gcc/testsuite/g++.dg/lookup/two-stage2.C: fix comment.
+ * g++.dg/lookup/two-stage2.C: fix comment.
2008-01-18 Ian Lance Taylor <iant@google.com>
@@ -4411,7 +4494,7 @@
2007-11-20 Richard Guenther <rguenther@suse.de>
PR middle-end/34154
- * testsuite/gcc.c-torture/execute/pr34154.c: New testcase.
+ * gcc.c-torture/execute/pr34154.c: New testcase.
2007-11-20 Uros Bizjak <ubizjak@gmail.com>
diff --git a/gcc/testsuite/g++.dg/gomp/pr35751.C b/gcc/testsuite/g++.dg/gomp/pr35751.C
new file mode 100644
index 00000000000..0b6cded5929
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr35751.C
@@ -0,0 +1,34 @@
+// PR c/35751
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+void
+foo (int i)
+{
+ extern int a[i]; // { dg-error "storage size of" }
+ static int b[i]; // { dg-error "storage size of" }
+
+#pragma omp parallel
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel shared (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel private (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel firstprivate (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c
new file mode 100644
index 00000000000..4b8438733e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-6.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (char* p)
+{
+ return p + 1000 < p; /* { dg-warning "assuming pointer wraparound does not occur" "correct warning" } */
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pr35739.c b/gcc/testsuite/gcc.dg/dfp/pr35739.c
new file mode 100644
index 00000000000..d4e1839026e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pr35739.c
@@ -0,0 +1,16 @@
+/* PR c/35739 */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O -fpreprocessed -fmudflap" } */
+
+_Decimal128
+foo (int n, ...)
+{
+ int i;
+ _Decimal128 j = 0;
+ __builtin_va_list ap;
+ __builtin_va_start (ap, n);
+ for (i = 0; i < n; i++)
+ j += __builtin_va_arg (ap, _Decimal128);
+ __builtin_va_end (ap);
+ return j;
+}
diff --git a/gcc/testsuite/gcc.dg/fold-compare-2.c b/gcc/testsuite/gcc.dg/fold-compare-2.c
index bcdb7ad3fcb..6674c4dad6e 100644
--- a/gcc/testsuite/gcc.dg/fold-compare-2.c
+++ b/gcc/testsuite/gcc.dg/fold-compare-2.c
@@ -15,6 +15,6 @@ main(void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "Removing basic block" 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Removing basic block" 2 "vrp1" } } */
/* { dg-final { cleanup-tree-dump "vrp\[1-2\]" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/pr35751.c b/gcc/testsuite/gcc.dg/gomp/pr35751.c
new file mode 100644
index 00000000000..f7777a5b79a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr35751.c
@@ -0,0 +1,34 @@
+/* PR c/35751 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (int i)
+{
+ extern int a[i]; /* { dg-error "must have no linkage|storage size of" } */
+ static int b[i]; /* { dg-error "storage size of" } */
+
+#pragma omp parallel
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel shared (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel private (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel firstprivate (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/no-strict-overflow-7.c b/gcc/testsuite/gcc.dg/no-strict-overflow-7.c
new file mode 100644
index 00000000000..07ad27b1f87
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/no-strict-overflow-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-final_cleanup" } */
+
+/* Source: Ian Lance Taylor. Dual of strict-overflow-6.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (char* p)
+{
+ return p + 1000 < p;
+}
+
+/* { dg-final { scan-tree-dump "\[+\]\[ \]*1000" "final_cleanup" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/pr35899.c b/gcc/testsuite/gcc.dg/pr35899.c
new file mode 100644
index 00000000000..113cbc87a7d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35899.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/35899 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a = bar (); /* { dg-warning "previous implicit declaration" } */
+ return a;
+}
+
+void
+bar (void) /* { dg-warning "conflicting types for" } */
+{
+}
diff --git a/gcc/testsuite/gcc.dg/strict-overflow-6.c b/gcc/testsuite/gcc.dg/strict-overflow-6.c
new file mode 100644
index 00000000000..ec1266d1b49
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strict-overflow-6.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-7.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (char* p)
+{
+ return p + 1000 < p;
+}
+
+/* { dg-final { scan-tree-dump-not "\[+\]\[ \]*1000" "final_cleanup" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-15.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-15.c
index 4155b030c88..a8f61153231 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/alias-15.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-15.c
@@ -11,10 +11,9 @@ static inline struct X *wrap(struct X *p) { return p; }
int test2(void)
{
struct X *p = wrap(&m.b);
- /* Both memory references need to alias the same SFT. */
+ /* Both memory references need to alias the same tags. */
return p->b[3] - m.b.b[3];
}
-/* { dg-final { scan-tree-dump "SFT.5 created for var m offset 128" "salias" } } */
-/* { dg-final { scan-tree-dump-times "VUSE <SFT.5_" 2 "salias" } } */
+/* { dg-final { scan-tree-dump-times "VUSE <m_.\\\(D\\\)>" 2 "salias" } } */
/* { dg-final { cleanup-tree-dump "salias" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c
index 8dbe13f59af..75580c1f725 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c
@@ -119,10 +119,11 @@ void test5 (void)
}
/* { dg-final { scan-tree-dump-times "Disambiguating loop" 5 "profile" } } */
-/* { dg-final { scan-tree-dump-times "Found latch edge" 5 "profile" } } */
-/* { dg-final { scan-tree-dump-times "Merged latch edges" 2 "profile" } } */
-/* { dg-final { scan-tree-dump-times "4 loops found" 2 "profile" } } */
-/* { dg-final { scan-tree-dump-times "3 loops found" 2 "profile" } } */
-/* { dg-final { scan-tree-dump-times "2 loops found" 1 "profile" } } */
+/* For the following xfail marks, see PR35629. */
+/* { dg-final { scan-tree-dump-times "Found latch edge" 5 "profile" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Merged latch edges" 2 "profile" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "4 loops found" 2 "profile" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "3 loops found" 2 "profile" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "2 loops found" 1 "profile" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "profile" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
new file mode 100644
index 00000000000..ce6ba28d74a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
@@ -0,0 +1,64 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim-details" } */
+
+int x;
+int a[100];
+
+struct a
+{
+ int X;
+ int Y;
+};
+
+struct a arr[100];
+
+void test1(int b)
+{
+ unsigned i;
+
+ /* And here. */
+ for (i = 0; i < 100; i++)
+ {
+ arr[b+8].X += i;
+ arr[b+9].X += i;
+ }
+}
+
+void test2(struct a *A, int b)
+{
+ unsigned i;
+
+ /* And here as well. */
+ for (i = 0; i < 100; i++)
+ {
+ A[b].X += i;
+ A[b+1].Y += i;
+ }
+}
+
+void test3(unsigned long b)
+{
+ unsigned i;
+
+ /* And here. */
+ for (i = 0; i < 100; i++)
+ {
+ arr[b+8].X += i;
+ arr[b+9].X += i;
+ }
+}
+
+void test4(struct a *A, unsigned long b)
+{
+ unsigned i;
+
+ /* And here as well. */
+ for (i = 0; i < 100; i++)
+ {
+ A[b].X += i;
+ A[b+1].Y += i;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim" } } */
+/* { dg-final { cleanup-tree-dump "lim" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c
index 1498ad75d25..ffaccefe94c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c
@@ -15,5 +15,6 @@ foo (int *p)
return 0;
}
-/* { dg-final { scan-tree-dump-times "Folding predicate " 2 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate " 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-not "b_. =" "vrp1" } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c b/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c
index ef5bc6a5341..2b2f497bd4b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c
@@ -16,5 +16,7 @@ int foo(void)
return a.i;
}
-/* { dg-final { scan-tree-dump-times "VDEF" 4 "salias" } } */
+/* Verify the call clobbers all of a. */
+
+/* { dg-final { scan-tree-dump-times "VDEF <a_" 2 "salias" } } */
/* { dg-final { cleanup-tree-dump "salias" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/salias-1.c b/gcc/testsuite/gcc.dg/tree-ssa/salias-1.c
deleted file mode 100644
index 5e47db40a73..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/salias-1.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-salias" } */
-
-struct {
- struct {
- struct {
- int i, j;
- } c;
- } b;
-} a;
-
-int foo(void)
-{
- a.b.c.i = 0;
- return a.b.c.j;
-}
-
-/* { dg-final { scan-tree-dump-times "structure field tag SFT" 2 "salias" } } */
-/* { dg-final { cleanup-tree-dump "salias" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c
index 91956017898..b88a1e58af6 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-lim-details" } */
+/* { dg-options "-O2 -fdump-tree-lim-details" } */
struct { int x; int y; } global;
void foo(int n)
diff --git a/gcc/testsuite/gfortran.dg/pr35662.f90 b/gcc/testsuite/gfortran.dg/pr35662.f90
new file mode 100644
index 00000000000..33095f0026d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr35662.f90
@@ -0,0 +1,20 @@
+! PR target/35662
+! { dg-do run }
+! { dg-options "-O1" }
+
+subroutine f(x, y, z)
+ real, intent (in) :: x
+ real, intent (out) :: y, z
+ y = sin (x)
+ z = cos (x)
+end subroutine f
+
+program pr35662
+ real :: x, y, z
+ x = 3.1415926535897932384626433832795029
+ call f (x, y, z)
+ if (abs (y) > 1.0e-5 .or. abs (z + 1.0) > 1.0e-5) call abort
+ x = x / 2.0
+ call f (x, y, z)
+ if (abs (y - 1.0) > 1.0e-5 .or. abs (z) > 1.0e-5) call abort
+end program pr35662
diff --git a/gcc/testsuite/gfortran.dg/pr35944-1.f90 b/gcc/testsuite/gfortran.dg/pr35944-1.f90
new file mode 100644
index 00000000000..76521cad9e9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr35944-1.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+
+ implicit none
+ integer i
+ real rda1(10), rda(10), rval
+ double precision dda1(10), dda(10), dval
+
+ rda = (/ 1,2,3,4,5,6,7,8,9,10 /)
+ rDA1 = MOD (1.1*(rDA(1)-5.0), P=(rDA-2.5))
+ DO i = 1, 10
+ rVAL = MOD (1.1*(rDA(1)-5.0), P=(rDA(i)-2.5))
+ if (rval /= rda1(i)) call abort
+ enddo
+
+ dda = (/ 1,2,3,4,5,6,7,8,9,10 /)
+ dDA1 = MOD (1.1d0*(dDA(1)-5.0d0), P=(dDA-2.5d0))
+ DO i = 1, 10
+ dVAL = MOD (1.1d0*(dDA(1)-5.0d0), P=(dDA(i)-2.5d0))
+ if (dval /= dda1(i)) call abort
+ enddo
+
+end
diff --git a/gcc/testsuite/gfortran.dg/pr35944-2.f90 b/gcc/testsuite/gfortran.dg/pr35944-2.f90
new file mode 100644
index 00000000000..976332ded00
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr35944-2.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! { dg-require-effective-target fortran_large_real }
+
+ implicit none
+ integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
+ integer :: i
+ real(k) :: qda1(10), qda(10), qval
+
+ qda = (/ 1,2,3,4,5,6,7,8,9,10 /)
+ QDA1 = MOD (1.1_k*(QDA(1)-5.0_k), P=(QDA-2.5_k))
+ DO i = 1, 10
+ QVAL = MOD (1.1_k*(QDA(1)-5.0_k), P=(QDA(i)-2.5_k))
+ if (qval /= qda1(i)) call abort
+ enddo
+end
diff --git a/gcc/testsuite/gnat.dg/incomplete1.ads b/gcc/testsuite/gnat.dg/incomplete1.ads
new file mode 100644
index 00000000000..34900335d8a
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/incomplete1.ads
@@ -0,0 +1,3 @@
+package Incomplete1 is
+ type T is null record;
+end Incomplete1;
diff --git a/gcc/testsuite/gnat.dg/incomplete2.adb b/gcc/testsuite/gnat.dg/incomplete2.adb
new file mode 100644
index 00000000000..19c83609b01
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/incomplete2.adb
@@ -0,0 +1,4 @@
+-- { dg-do compile }
+-- { dg-excess-errors "instantiation abandoned" }
+with Incomplete1;
+package body Incomplete2 is end Incomplete2;
diff --git a/gcc/testsuite/gnat.dg/incomplete2.ads b/gcc/testsuite/gnat.dg/incomplete2.ads
new file mode 100644
index 00000000000..21f2d2bb1bd
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/incomplete2.ads
@@ -0,0 +1,8 @@
+limited with Incomplete1;
+package Incomplete2 is
+ pragma Elaborate_Body;
+ generic
+ type T is private;
+ package G is end G;
+ package I1 is new G (Incomplete1.T); -- { dg-error "premature use" }
+end Incomplete2;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization1.adb b/gcc/testsuite/gnat.dg/loop_optimization1.adb
new file mode 100644
index 00000000000..8875c1f8d81
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization1.adb
@@ -0,0 +1,27 @@
+-- { dg-do compile }
+-- { dg-options "-O3" }
+
+package body Loop_Optimization1 is
+
+ procedure Create (A : in out D; Val : Integer) is
+
+ M : constant Group_Chain_List := Group_Chains(Val);
+ G : constant Group_List := Groups(Val);
+
+ function Is_Visible (Group : Number) return Boolean is
+ begin
+ for I in M'Range loop
+ if Group = M(I).Groups(M(I).Length) then
+ return True;
+ end if;
+ end loop;
+ return False;
+ end;
+
+ begin
+ for I in A.L'Range loop
+ A.L(I) := new R(Is_Visible(G(I)));
+ end loop;
+ end;
+
+end Loop_Optimization1;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization1.ads b/gcc/testsuite/gnat.dg/loop_optimization1.ads
new file mode 100644
index 00000000000..2c3f419b50d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization1.ads
@@ -0,0 +1,35 @@
+package Loop_Optimization1 is
+
+ type Number is range 0 .. 127;
+
+ type Group_List is array (Positive range <>) of Number;
+
+ subtype Index is Natural range 1 .. 5;
+
+ function Groups (T : Integer) return Group_List;
+ pragma Import (Ada, Groups);
+
+ type Group_Chain (Length : Index := 1) is record
+ Groups : Group_List(1 .. Length);
+ end record;
+
+ type Group_Chain_List is array (Positive range <>) of Group_Chain;
+
+ function Group_Chains (T : Integer) return Group_Chain_List;
+ pragma Import (Ada, Group_Chains);
+
+ type R (I : Boolean) is null record;
+
+ type R_Access is access R;
+
+ type R_List is array (Positive range <>) of R_Access;
+
+ type R_List_Access is access R_List;
+
+ type D is record
+ L : R_List_Access;
+ end record;
+
+ procedure Create (A : in out D; Val : Integer);
+
+end Loop_Optimization1;
diff --git a/gcc/testsuite/gnat.dg/prot_def.adb b/gcc/testsuite/gnat.dg/prot_def.adb
new file mode 100644
index 00000000000..d56195ea483
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/prot_def.adb
@@ -0,0 +1,44 @@
+-- { dg-do run }
+procedure Prot_Def is
+
+ protected Prot is
+ procedure Inc;
+ function Get return Integer;
+ private
+ Data : Integer := 0;
+ end Prot;
+
+ protected body Prot is
+ procedure Inc is
+ begin
+ Data := Data + 1;
+ end Inc;
+ function Get return Integer is
+ begin
+ return Data;
+ end Get;
+ end Prot;
+
+ generic
+ with procedure Inc is Prot.Inc;
+ with function Get return Integer is Prot.Get;
+ package Gen is
+ function Add2_Get return Integer;
+ end Gen;
+
+ package body Gen is
+ function Add2_Get return Integer is
+ begin
+ Inc;
+ Inc;
+ return Get;
+ end Add2_Get;
+ end Gen;
+
+ package Inst is new Gen;
+
+begin
+ if Inst.Add2_Get /= 2 then
+ raise Constraint_Error;
+ end if;
+end Prot_Def;
diff --git a/gcc/testsuite/gnat.dg/specs/corr_discr.ads b/gcc/testsuite/gnat.dg/specs/corr_discr.ads
new file mode 100644
index 00000000000..70ea860565f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/corr_discr.ads
@@ -0,0 +1,13 @@
+package Corr_Discr is
+
+ type Base (T1 : Boolean := True; T2 : Boolean := False)
+ is null record;
+ for Base use record
+ T1 at 0 range 0 .. 0;
+ T2 at 0 range 1 .. 1;
+ end record;
+
+ type Deriv (D : Boolean := False) is new Base (T1 => True, T2 => D);
+
+end Corr_Discr;
+
diff --git a/gcc/testsuite/gnat.dg/specs/linker_section.ads b/gcc/testsuite/gnat.dg/specs/linker_section.ads
index ae2d4029cf9..73e89aa48e1 100644
--- a/gcc/testsuite/gnat.dg/specs/linker_section.ads
+++ b/gcc/testsuite/gnat.dg/specs/linker_section.ads
@@ -3,8 +3,11 @@ package Linker_Section is
pragma Linker_Section (Entity => Data1,
Section => ".eeprom");
type EEPROM_String is new String;
- pragma Linker_Section (Entity => EEPROM_String, -- { dg-error "type" }
+ pragma Linker_Section (Entity => EEPROM_String, -- { dg-error "objects" }
Section => ".eeprom");
Data2 : constant EEPROM_String := "12345678901234567";
+ package Inner is end;
+ pragma Linker_Section (Entity => Inner, -- { dg-error "objects" }
+ Section => ".eeprom");
end Linker_Section;
diff --git a/gcc/testsuite/gnat.dg/specs/storage.ads b/gcc/testsuite/gnat.dg/specs/storage.ads
index 85a91d0724e..e544457930d 100644
--- a/gcc/testsuite/gnat.dg/specs/storage.ads
+++ b/gcc/testsuite/gnat.dg/specs/storage.ads
@@ -3,7 +3,7 @@ with System.Pool_Global;
package Storage is
x1: System.Pool_Global.Unbounded_No_Reclaim_Pool;
type T1 is access integer;
- for T1'Storage_Pool use (x1); -- { dg-error "denote a variable" }
+ for T1'Storage_Pool use (x1); -- { dg-error "must be a variable" }
type T2 is access Integer;
for T2'Storage_Pool use x1;
end Storage;
diff --git a/gcc/testsuite/gnat.dg/string_slice2.adb b/gcc/testsuite/gnat.dg/string_slice2.adb
new file mode 100644
index 00000000000..e9a9efaa132
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/string_slice2.adb
@@ -0,0 +1,24 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Ada.Strings;
+with Ada.Strings.Fixed;
+
+procedure String_Slice2 is
+
+ package ASF renames Ada.Strings.Fixed;
+
+ Delete_String : String(1..10);
+ Source_String2 : String(1..12) := "abcdefghijkl";
+
+begin
+
+ Delete_String := Source_String2(1..10);
+
+ ASF.Delete(Source => Delete_String,
+ From => 6,
+ Through => Delete_String'Last,
+ Justify => Ada.Strings.Left,
+ Pad => 'x');
+
+end;
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 54f36b98135..8407df204a2 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "pointer-set.h"
#include "tree-affine.h"
#include "tree-gimple.h"
+#include "flags.h"
/* Extends CST as appropriate for the affine combinations COMB. */
@@ -578,12 +579,20 @@ aff_combination_expand (aff_tree *comb, struct pointer_map_t **cache)
aff_combination_zero (&to_add, comb->type);
for (i = 0; i < comb->n; i++)
{
+ tree type, name;
e = comb->elts[i].val;
- if (TREE_CODE (e) != SSA_NAME)
+ type = TREE_TYPE (e);
+ name = e;
+ /* Look through some conversions. */
+ if (TREE_CODE (e) == NOP_EXPR
+ && (TYPE_PRECISION (type)
+ >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (e, 0)))))
+ name = TREE_OPERAND (e, 0);
+ if (TREE_CODE (name) != SSA_NAME)
continue;
- def = SSA_NAME_DEF_STMT (e);
+ def = SSA_NAME_DEF_STMT (name);
if (TREE_CODE (def) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (def, 0) != e)
+ || GIMPLE_STMT_OPERAND (def, 0) != name)
continue;
rhs = GIMPLE_STMT_OPERAND (def, 1);
@@ -607,6 +616,30 @@ aff_combination_expand (aff_tree *comb, struct pointer_map_t **cache)
exp = XNEW (struct name_expansion);
exp->in_progress = 1;
*slot = exp;
+ if (e != name)
+ {
+ /* In principle this is a generally valid folding, but
+ it is not unconditionally an optimization, so do it
+ here and not in fold_unary. */
+ /* Convert (T1)(X *+- CST) into (T1)X *+- (T1)CST if T1 is wider
+ than the type of X and overflow for the type of X is
+ undefined. */
+ if (INTEGRAL_TYPE_P (type)
+ && INTEGRAL_TYPE_P (TREE_TYPE (rhs))
+ && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (rhs))
+ && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (rhs))
+ && (TREE_CODE (rhs) == PLUS_EXPR
+ || TREE_CODE (rhs) == MINUS_EXPR
+ || TREE_CODE (rhs) == MULT_EXPR)
+ && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
+ {
+ rhs = fold_build2 (TREE_CODE (rhs), type,
+ fold_convert (type, TREE_OPERAND (rhs, 0)),
+ fold_convert (type, TREE_OPERAND (rhs, 1)));
+ }
+ else
+ rhs = fold_convert (type, rhs);
+ }
tree_to_aff_combination_expand (rhs, comb->type, &current, cache);
exp->expansion = current;
exp->in_progress = 0;
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 091a45a1439..6373d5eebea 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2868,15 +2868,15 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
{
- tree name = TREE_OPERAND (stmt, 0);
- tree var = SSA_NAME_VAR (TREE_OPERAND (stmt, 0));
+ tree name = GIMPLE_STMT_OPERAND (stmt, 0);
+ tree var = SSA_NAME_VAR (GIMPLE_STMT_OPERAND (stmt, 0));
tree def = gimple_default_def (cfun, var);
/* If the variable is used undefined, make this name undefined via
move. */
if (def)
{
- TREE_OPERAND (stmt, 1) = def;
+ GIMPLE_STMT_OPERAND (stmt, 1) = def;
update_stmt (stmt);
}
/* Otherwise make this variable undefined. */
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 7330d2896b5..35928ea99e7 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -1,5 +1,5 @@
/* Language independent return value optimizations
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -115,6 +115,11 @@ tree_nrv (void)
if (!aggregate_value_p (result, current_function_decl))
return 0;
+ /* If a GIMPLE type is returned in memory, finalize_nrv_r might create
+ non-GIMPLE. */
+ if (is_gimple_reg_type (result_type))
+ return 0;
+
/* Look through each block for assignments to the RESULT_DECL. */
FOR_EACH_BB (bb)
{
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 6fa80ee6133..dfb53420e8f 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -590,7 +590,8 @@ suitable_reference_p (struct data_reference *a, enum ref_step_type *ref_step)
tree ref = DR_REF (a), step = DR_STEP (a);
if (!step
- || !is_gimple_reg_type (TREE_TYPE (ref)))
+ || !is_gimple_reg_type (TREE_TYPE (ref))
+ || tree_could_throw_p (ref))
return false;
if (integer_zerop (step))
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 8b5f847e476..1faeab182dc 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -784,7 +784,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
/* Would "%x%0*x" or "%x%*0x" get zero-padding on all
systems? */
sprintf (pp_buffer (buffer)->digit_buffer,
- HOST_WIDE_INT_PRINT_DOUBLE_HEX, high, low);
+ HOST_WIDE_INT_PRINT_DOUBLE_HEX,
+ (unsigned HOST_WIDE_INT) high, low);
pp_string (buffer, pp_buffer (buffer)->digit_buffer);
}
else
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 98847fb377a..c37cfa53545 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -1211,10 +1211,12 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
replace_phi_args_in (phi, prop_value);
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ /* Propagate known values into stmts. Do a backward walk to expose
+ more trivially deletable stmts. */
+ for (i = bsi_last (bb); !bsi_end_p (i);)
{
bool replaced_address, did_replace;
- tree prev_stmt = NULL;
+ tree call, prev_stmt = NULL;
tree stmt = bsi_stmt (i);
/* Ignore ASSERT_EXPRs. They are used by VRP to generate
@@ -1222,7 +1224,33 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
afterwards. */
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR)
- continue;
+ {
+ bsi_prev (&i);
+ continue;
+ }
+
+ /* No point propagating into a stmt whose result is not used,
+ but instead we might be able to remove a trivially dead stmt. */
+ if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
+ && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
+ && !stmt_ann (stmt)->has_volatile_ops
+ && has_zero_uses (GIMPLE_STMT_OPERAND (stmt, 0))
+ && !tree_could_throw_p (stmt)
+ && (!(call = get_call_expr_in (stmt))
+ || !TREE_SIDE_EFFECTS (call)))
+ {
+ if (dump_file && dump_flags & TDF_DETAILS)
+ {
+ fprintf (dump_file, "Removing dead stmt ");
+ print_generic_expr (dump_file, stmt, 0);
+ fprintf (dump_file, "\n");
+ }
+ bsi_remove (&i, true);
+ release_defs (stmt);
+ if (!bsi_end_p (i))
+ bsi_prev (&i);
+ continue;
+ }
/* Record the state of the statement before replacements. */
push_stmt_changes (bsi_stmt_ptr (i));
@@ -1298,6 +1326,8 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
statement. */
if (use_ranges_p)
simplify_stmt_using_ranges (stmt);
+
+ bsi_prev (&i);
}
}
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index b613b2ba21f..849eade1d21 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -735,7 +735,7 @@ vn_reference_lookup_1 (vn_reference_t vr)
it does not exist in the hash table. */
tree
-vn_reference_lookup (tree op, VEC (tree, gc) *vuses)
+vn_reference_lookup (tree op, VEC (tree, gc) *vuses, bool maywalk)
{
struct vn_reference_s vr1;
tree result, def_stmt;
@@ -748,6 +748,7 @@ vn_reference_lookup (tree op, VEC (tree, gc) *vuses)
/* If there is a single defining statement for all virtual uses, we can
use that, following virtual use-def chains. */
if (!result
+ && maywalk
&& vr1.vuses
&& VEC_length (tree, vr1.vuses) >= 1
&& !get_call_expr_in (op)
@@ -1188,7 +1189,7 @@ static bool
visit_reference_op_load (tree lhs, tree op, tree stmt)
{
bool changed = false;
- tree result = vn_reference_lookup (op, shared_vuses_from_stmt (stmt));
+ tree result = vn_reference_lookup (op, shared_vuses_from_stmt (stmt), true);
/* We handle type-punning through unions by value-numbering based
on offset and size of the access. Be prepared to handle a
@@ -1294,7 +1295,7 @@ visit_reference_op_store (tree lhs, tree op, tree stmt)
Otherwise, the vdefs for the store are used when inserting into
the table, since the store generates a new memory state. */
- result = vn_reference_lookup (lhs, shared_vuses_from_stmt (stmt));
+ result = vn_reference_lookup (lhs, shared_vuses_from_stmt (stmt), false);
if (result)
{
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index 55d9831f504..ecc3297af42 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -59,7 +59,7 @@ void free_scc_vn (void);
void switch_to_PRE_table (void);
tree vn_nary_op_lookup (tree);
void vn_nary_op_insert (tree, tree);
-tree vn_reference_lookup (tree, VEC (tree, gc) *);
+tree vn_reference_lookup (tree, VEC (tree, gc) *, bool);
void vn_reference_insert (tree, tree, VEC (tree, gc) *);
VEC (tree, gc) *shared_vuses_from_stmt (tree);
VEC (tree, gc) *copy_vuses_from_stmt (tree);
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index cecafca673a..6f6eff422da 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2657,11 +2657,6 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results)
t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize);
- /* String constants are readonly, so there is nothing to really do
- here. */
- if (TREE_CODE (t) == STRING_CST)
- return;
-
get_constraint_for (t, results);
result = VEC_last (ce_s, *results);
result->offset = bitpos;
@@ -2779,6 +2774,16 @@ get_constraint_for (tree t, VEC (ce_s, heap) **results)
return;
}
+ /* String constants are read-only. */
+ if (TREE_CODE (t) == STRING_CST)
+ {
+ temp.var = readonly_id;
+ temp.type = SCALAR;
+ temp.offset = 0;
+ VEC_safe_push (ce_s, heap, *results, &temp);
+ return;
+ }
+
switch (TREE_CODE_CLASS (TREE_CODE (t)))
{
case tcc_expression:
diff --git a/gcc/tree-vn.c b/gcc/tree-vn.c
index 2122a7e432e..c09dfb76284 100644
--- a/gcc/tree-vn.c
+++ b/gcc/tree-vn.c
@@ -255,7 +255,7 @@ vn_lookup (tree expr)
/* In the case of array-refs of constants, for example, we can
end up with no vuses. */
case tcc_reference:
- return vn_reference_lookup (expr, NULL);
+ return vn_reference_lookup (expr, NULL, false);
break;
/* It is possible to have CALL_EXPR with no vuses for things
like "cos", and these will fall into vn_lookup. */
@@ -264,7 +264,7 @@ vn_lookup (tree expr)
case tcc_expression:
case tcc_declaration:
if (TREE_CODE (expr) == CALL_EXPR || DECL_P (expr))
- return vn_reference_lookup (expr, NULL);
+ return vn_reference_lookup (expr, NULL, false);
else if (TREE_CODE (expr) == SSA_NAME)
return SSA_NAME_VALUE (expr);
else if (TREE_CODE (expr) == ADDR_EXPR)
@@ -308,7 +308,7 @@ vn_lookup_with_vuses (tree expr, VEC (tree, gc) *vuses)
if (is_gimple_min_invariant (expr) || TREE_CODE (expr) == FIELD_DECL)
return expr;
- return vn_reference_lookup (expr, vuses);
+ return vn_reference_lookup (expr, vuses, true);
}
static tree
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index e228cf6db8c..9fc0476272f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-14 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/32972
+ * intrinsics/spread_generic.c (spread): Use spread_i2()
+ for GFC_DTYPE_DERIVED_2 (fix typo from previous commit).
+
2008-04-13 Thomas Koenig <tkoenig@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
diff --git a/libgfortran/intrinsics/spread_generic.c b/libgfortran/intrinsics/spread_generic.c
index e50598a97c3..e37b6e10bbc 100644
--- a/libgfortran/intrinsics/spread_generic.c
+++ b/libgfortran/intrinsics/spread_generic.c
@@ -367,7 +367,7 @@ spread (gfc_array_char *ret, const gfc_array_char *source,
break;
else
{
- spread_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) source,
+ spread_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) source,
*along, *pncopies);
return;
}
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 1372e44b1b5..9adb8a7dade 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-16 Andrew Haley <aph@littlepinkcloud.com>
+
+ * libgcj_bc.c: (_Jv_LookupInterfaceMethod, _Jv_MonitorExit,
+ _Jv_RegisterResource, _Jv_JNI_PopSystemFrame): Add.
+
+2008-04-16 Andrew Haley <aph@redhat.com>
+
+ * libgcj_bc.c: Sort lines.
+
2008-04-02 Peter O'Gorman <pogma@thewrittenword.com>
PR bootstrap/35216
diff --git a/libjava/libgcj_bc.c b/libjava/libgcj_bc.c
index b26e3f7a1ea..7073d7308b2 100644
--- a/libjava/libgcj_bc.c
+++ b/libjava/libgcj_bc.c
@@ -26,24 +26,27 @@ Please create a symlink from libgcj_bc.so.1 to the real libgcj.so.\n");
/* Functions called from code generated by gcj. */
-void __gcj_personality_v0 () {}
void _Jv_AllocObject () {}
void _Jv_AllocObjectNoFinalizer () {}
+void _Jv_CheckArrayStore () {}
+void _Jv_CheckCast () {}
void _Jv_InitClass () {}
-void _Jv_ResolvePoolEntry () {}
-void _Jv_Throw () {}
+void _Jv_IsInstanceOf () {}
+void _Jv_LookupInterfaceMethod () {}
+void _Jv_LookupInterfaceMethodIdx () {}
void _Jv_MonitorEnter () {}
-void _Jv_NewPrimArray () {}
-void _Jv_NewObjectArray () {}
+void _Jv_MonitorExit () {}
void _Jv_NewMultiArray () {}
-void _Jv_ThrowBadArrayIndex () {}
-void _Jv_ThrowNullPointerException () {}
+void _Jv_NewObjectArray () {}
+void _Jv_NewPrimArray () {}
+void _Jv_RegisterResource () {}
+void _Jv_ResolvePoolEntry () {}
+void _Jv_Throw () {}
void _Jv_ThrowAbstractMethodError () {}
+void _Jv_ThrowBadArrayIndex () {}
void _Jv_ThrowNoSuchFieldError () {}
-void _Jv_CheckCast () {}
-void _Jv_IsInstanceOf () {}
-void _Jv_CheckArrayStore () {}
-void _Jv_LookupInterfaceMethodIdx () {}
+void _Jv_ThrowNullPointerException () {}
+void __gcj_personality_v0 () {}
void _Jv_RegisterClasses ()
{
@@ -63,16 +66,17 @@ const char **_Jv_Compiler_Properties;
/* Functions used by -fjni. */
-void _Jv_LookupJNIMethod () {}
void _Jv_GetJNIEnvNewFrame () {}
+void _Jv_LookupJNIMethod () {}
void _Jv_UnwrapJNIweakReference () {}
+void _Jv_JNI_PopSystemFrame () {}
/* Checked divide (-fuse-divide-subroutine). */
void _Jv_divI () {}
-void _Jv_remI () {}
void _Jv_divJ () {}
+void _Jv_remI () {}
void _Jv_remJ () {}
@@ -80,19 +84,19 @@ void _Jv_remJ () {}
void _Jv_AllocBytes () {}
void _Jv_AllocString () {}
-void _Jv_NewString () {}
-void _Jv_NewStringLatin1 () {}
+void _Jv_AttachCurrentThread () {}
+void _Jv_AttachCurrentThreadAsDaemon () {}
+void _Jv_CreateJavaVM () {}
+void _Jv_DetachCurrentThread () {}
+void _Jv_Free () {}
void _Jv_GetStringChars () {}
void _Jv_GetStringUTFLength () {}
void _Jv_GetStringUTFRegion () {}
-void _Jv_NewStringUTF () {}
void _Jv_Malloc () {}
+void _Jv_NewString () {}
+void _Jv_NewStringLatin1 () {}
+void _Jv_NewStringUTF () {}
void _Jv_Realloc () {}
-void _Jv_Free () {}
-void _Jv_CreateJavaVM () {}
-void _Jv_AttachCurrentThread () {}
-void _Jv_AttachCurrentThreadAsDaemon () {}
-void _Jv_DetachCurrentThread () {}
/* Classes for primitive types. */
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0c6e5206916..fb3e6224579 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/35816
+ * acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Set CXXFLAGS to
+ -O0 when checking for atomic builtins.
+ * configure: Regenerate.
+
+2008-04-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/c++config: Guard _LDBL_ macros with __cplusplus.
+
2008-04-10 Benjamin Kosnik <bkoz@redhat.com>
* doc/html/*: Regenerate.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index e1712b77d80..b25c5add572 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2292,7 +2292,7 @@ int main()
}
EOF
old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
+ CXXFLAGS='-O0 -S'
if AC_TRY_EVAL(ac_compile); then
if grep __sync_fetch_and_add conftest.s >/dev/null 2>&1 ; then
enable_atomic_builtins=no
@@ -2303,6 +2303,7 @@ EOF
atomicity_dir=cpu/generic/atomicity_builtins
fi
fi
+ AC_MSG_RESULT($enable_atomic_builtins)
CXXFLAGS="$old_CXXFLAGS"
rm -f conftest*
@@ -2311,7 +2312,6 @@ EOF
atomicity_dir=cpu/generic/atomicity_mutex
fi
AC_LANG_RESTORE
- AC_MSG_RESULT($enable_atomic_builtins)
])
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 27fb6957ee4..00c5c8aa8cf 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -17976,7 +17976,7 @@ int main()
}
EOF
old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
+ CXXFLAGS='-O0 -S'
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -17994,6 +17994,8 @@ _ACEOF
atomicity_dir=cpu/generic/atomicity_builtins
fi
fi
+ echo "$as_me:$LINENO: result: $enable_atomic_builtins" >&5
+echo "${ECHO_T}$enable_atomic_builtins" >&6
CXXFLAGS="$old_CXXFLAGS"
rm -f conftest*
@@ -18007,8 +18009,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- echo "$as_me:$LINENO: result: $enable_atomic_builtins" >&5
-echo "${ECHO_T}$enable_atomic_builtins" >&6
if test $atomicity_dir = cpu/generic/atomicity_mutex ; then
{ echo "$as_me:$LINENO: WARNING: No native atomic operations are provided for this platform." >&5
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index e38cfe05184..498bc320265 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -236,7 +236,8 @@ namespace std
// XXX GLIBCXX_ABI Deprecated
// Namespace associations for long double 128 mode.
_GLIBCXX_BEGIN_NAMESPACE(std)
-#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \
+ && defined __cplusplus
# define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
# define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
# define _GLIBCXX_END_LDBL_NAMESPACE }