platform/upstream/linaro-gcc.git
12 years agolibatomic: Enable AM_MAINTAINER_MODE
rth [Thu, 3 May 2012 16:30:11 +0000 (16:30 +0000)]
libatomic: Enable AM_MAINTAINER_MODE

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187108 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * dwarf2out.c (die_struct): Add comdat_type_p flag. Use it instead of
jason [Thu, 3 May 2012 16:19:17 +0000 (16:19 +0000)]
* dwarf2out.c (die_struct): Add comdat_type_p flag.  Use it instead of
use_debug_types to discriminate the die_id union.
(print_die, assign_symbol_names, copy_decls_walk): Likewise.
(build_abbrev_table, output_die): Likewise.
(prune_unused_types_walk_attribs): Likewise.
(generate_type_signature, copy_declaration_context): Set it.
(remove_child_or_replace_with_skeleton): Set it.
(dwarf2out_start_source_file, dwarf2out_end_source_file): Don't
check use_debug_types.
(dwarf2out_finish): Do break_out_includes after .debug_types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187107 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * dwarf2out.c (modified_type_die): Use scope_die_for.
jason [Thu, 3 May 2012 16:19:02 +0000 (16:19 +0000)]
* dwarf2out.c (modified_type_die): Use scope_die_for.
(gen_type_die_with_usage, dwarf2out_finish): Likewise.
(uses_local_type_r, uses_local_type): New.
(scope_die_for): Keep a type that uses a local type in local scope.
Use get_context_die for namespace and type scope.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187106 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/i386/i386.c (ix86_code_end): Set DECL_IGNORED_P on the
jason [Thu, 3 May 2012 16:18:51 +0000 (16:18 +0000)]
* config/i386/i386.c (ix86_code_end): Set DECL_IGNORED_P on the
pc thunk.
* dwarf2out.c (output_aranges): Skip DECL_IGNORED_P functions.
(dwarf2out_finish): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187105 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agocompiler: Fix order of initialization bug with global var a, b = f().
ian [Thu, 3 May 2012 16:09:25 +0000 (16:09 +0000)]
compiler: Fix order of initialization bug with global var a, b = f().

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187103 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * acinclude.m4 (LIBAT_TEST_ATOMIC_BUILTIN): Handle compilation
rth [Thu, 3 May 2012 15:59:43 +0000 (15:59 +0000)]
    * acinclude.m4 (LIBAT_TEST_ATOMIC_BUILTIN): Handle compilation
        failure in gcc_no_link path.
        * configure: Rebuild.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187102 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-03 Martin Jambor <mjambor@suse.cz>
jamborm [Thu, 3 May 2012 15:48:56 +0000 (15:48 +0000)]
2012-05-03  Martin Jambor  <mjambor@suse.cz>

* builtins.c (get_object_alignment_1): Return whether we can determine
the alignment or conservatively assume byte alignment.  Return the
alignment by reference.  Use get_pointer_alignment_1 for dereference
alignment.
(get_pointer_alignment_1): Return whether we can determine the
alignment or conservatively assume byte alignment.  Return the
alignment by reference.  Use get_ptr_info_alignment to get SSA name
alignment.
(get_object_alignment): Update call to get_object_alignment_1.
(get_object_or_type_alignment): Likewise, fall back to type alignment
only when it returned false.
(get_pointer_alignment): Update call to get_pointer_alignment_1.
* fold-const.c (get_pointer_modulus_and_residue): Update call to
get_object_alignment_1.
* ipa-prop.c (ipa_modify_call_arguments): Update call to
get_pointer_alignment_1.
* tree-sra.c (build_ref_for_offset): Likewise, fall back to the type
of MEM_REF or TARGET_MEM_REF only when it returns false.
* tree-ssa-ccp.c (get_value_from_alignment): Update call to
get_object_alignment_1.
(ccp_finalize): Use set_ptr_info_alignment.
* tree.h (get_object_alignment_1): Update declaration.
(get_pointer_alignment_1): Likewise.
* gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment.
(dump_gimple_stmt): Likewise.
* tree-flow.h (ptr_info_def): Updated comments of fields align and
misalign.
(get_ptr_info_alignment): Declared.
(mark_ptr_info_alignment_unknown): Likewise.
(set_ptr_info_alignment): Likewise.
(adjust_ptr_info_misalignment): Likewise.
* tree-ssa-address.c (copy_ref_info): Use new access functions to get
and set alignment of SSA names.
* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call
mark_ptr_info_alignment_unknown.
* tree-ssanames.c (get_ptr_info_alignment): New function.
(mark_ptr_info_alignment_unknown): Likewise.
(set_ptr_info_alignment): Likewise.
(adjust_ptr_info_misalignment): Likewise.
(get_ptr_info): Call mark_ptr_info_alignment_unknown.
* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
Likewise.
(bump_vector_ptr): Likewise.
* tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment.
(vectorizable_store): Likewise.
(vectorizable_load): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187101 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/mh-ppc-aix (LDFLAGS): Quote $(CC).
hainque [Thu, 3 May 2012 15:39:07 +0000 (15:39 +0000)]
    * config/mh-ppc-aix (LDFLAGS): Quote $(CC).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187100 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * basic-block.h (struct rtl_bb_info, struct gimple_bb_info): Move
matz [Thu, 3 May 2012 14:34:07 +0000 (14:34 +0000)]
* basic-block.h (struct rtl_bb_info, struct gimple_bb_info): Move
in front of basic_block_def.
(struct basic_block_def): Make il.gimple the full struct, not a
pointer.
(__assert_gimple_bb_smaller_rtl_bb): Asserting typedef.

* cfgexpand.c (expand_gimple_basic_block): Clear all il.gimple
members.
* gimple-iterator.c (gimple_stmt_iterator): Don't special case
NULL il.gimple, which can't happen anymore.
* gimple.h (bb_seq): il.gimple can't be NULL.
(bb_seq_add): Ditto.
(set_bb_seq): Adjust.
(gsi_start_bb, gsi_last_bb): Tidy.
* lto-streamer-in.c (make_new_block): Don't zero members that
are zeroed already, don't allocate a gimple_bb_info.
* tree-cfg.c (create_bb): Don't allocate a gimple_bb_info.
(remove_bb): Clear all il.gimple members.
(gimple_verify_flow_info): Adjust for flat il.gimple.
* tree-flow-inline.h (phi_nodes, phi_nodes_ptr, set_phi_nodes): Adjust.

* coretypes.h (const_gimple_seq): Remove typedef.
* gimple.h (gimple_seq_first): Take gimple_seq.
(gimple_seq_first_stmt): Ditto.
(gimple_seq_last): Ditto.
(gimple_seq_last_stmt): Ditto.
(gimple_seq_empty_p): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187099 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago/cp
paolo [Thu, 3 May 2012 14:28:46 +0000 (14:28 +0000)]
/cp
2012-05-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/53186
* call.c (build_over_call): Handle final member functions
and class types.
(build_new_method_call_1): Do not handle here.

/testsuite
2012-05-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/53186
* g++.dg/other/final2.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187097 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-03 Richard Guenther <rguenther@suse.de>
rguenth [Thu, 3 May 2012 13:07:31 +0000 (13:07 +0000)]
2012-05-03  Richard Guenther  <rguenther@suse.de>

* tree-ssa-pre.c (valid_in_sets): Remove checking of trapping
operations.
(prune_clobbered_mems): Do it here.  Do not uselessly sort
expressions.
(compute_avail): Do not add possibly trapping operations to
EXP_GEN if they might not be executed in the block.

* gcc.dg/tree-ssa/ssa-pre-27.c: Remove XFAIL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187096 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/alpha/elf.h (MAX_OFILE_ALIGNMENT): Remove.
uros [Thu, 3 May 2012 12:03:01 +0000 (12:03 +0000)]
* config/alpha/elf.h (MAX_OFILE_ALIGNMENT): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187095 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * gcc.target/i386/hle-cmpxchg-acq-1.c (dg-options): Add -march=x86-64.
uros [Thu, 3 May 2012 11:54:58 +0000 (11:54 +0000)]
* gcc.target/i386/hle-cmpxchg-acq-1.c (dg-options): Add -march=x86-64.
* gcc.target/i386/hle-xadd-acq-1.c (dg-options): Ditto.
* gcc.target/i386/hle-cmpxchg-rel-1.c (dg-options): Ditto.
* gcc.target/i386/hle-xadd-rel-1.c (dg-options): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187094 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * tree-switch-conversion.c (gen_inbound_check): Free post-dominance
steven [Thu, 3 May 2012 11:14:15 +0000 (11:14 +0000)]
* tree-switch-conversion.c (gen_inbound_check): Free post-dominance
information as early as possible.  Update dominance info instead of
discarding it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187093 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-03 Richard Guenther <rguenther@suse.de>
rguenth [Thu, 3 May 2012 11:11:34 +0000 (11:11 +0000)]
2012-05-03  Richard Guenther  <rguenther@suse.de>

* tree-ssa-pre.c (debug_bitmap_sets_for): New function.
(union_contains_value): Remove.
(vro_valid_in_sets): Likewise.
(op_valid_in_sets): New function.
(valid_in_sets): Use op_valid_in_sets.
(insert_into_preds_of_block): Move dumping ...
(do_regular_insertion): ... here.
(do_partial_partial_insertion): ... and here.  Dump that
we've found a partial partial redundancy.
(insert): Dump the current insert iteration.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187092 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR plugins/53126
jakub [Thu, 3 May 2012 11:09:07 +0000 (11:09 +0000)]
PR plugins/53126
* gcc-ar.c (main): If GCC_EXEC_PREFIX is set in env,
append program name to it and pass that as first argument
to make_relative_prefix.  Always pass standard_libexec_prefix
as last argument to make_relative_prefix.  If
make_relative_prefix returns NULL, fall back to
standard_libexec_prefix.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187090 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * gcc.target/i386/hle-xadd-rel-1.c: Match .byte 0xf3 instead of
jakub [Thu, 3 May 2012 10:21:41 +0000 (10:21 +0000)]
* gcc.target/i386/hle-xadd-rel-1.c: Match .byte 0xf3 instead of
.byte 0xf2.
* gcc.target/i386/hle-sub-rel-1.c: Likewise.
* gcc.target/i386/hle-xchg-rel-1.c: Likewise.
* gcc.target/i386/hle-add-rel-1.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187089 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR debug/53174
jakub [Thu, 3 May 2012 10:18:34 +0000 (10:18 +0000)]
PR debug/53174
* tree-predcom.c (remove_stmt): Call reset_debug_uses on stmts being
removed.

* gcc.dg/pr53174.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187087 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR target/53187
jakub [Thu, 3 May 2012 10:16:01 +0000 (10:16 +0000)]
PR target/53187
* config/arm/arm.c (arm_select_cc_mode): If x has MODE_CC class
mode, return that mode.

* gcc.target/arm/pr53187.c: New test.
* gcc.c-torture/compile/pr53187.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187085 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR target/53194
jakub [Thu, 3 May 2012 10:12:33 +0000 (10:12 +0000)]
PR target/53194
* config/i386/i386-c.c (ix86_target_macros_internal): Don't
define __ATOMIC_HLE_* macros here.
(ix86_target_macros): But here, using cpp_define_formatted.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187084 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-03 Richard Guenther <rguenther@suse.de>
rguenth [Thu, 3 May 2012 09:47:06 +0000 (09:47 +0000)]
2012-05-03  Richard Guenther  <rguenther@suse.de>

* gfortran.dg/pr52621.f90: Add -w to avoid diagnostic about
unsupported prefetching support.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187082 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agogcc/testsuite
gretay [Thu, 3 May 2012 09:18:57 +0000 (09:18 +0000)]
gcc/testsuite

2012-05-03  Greta Yorsh  <Greta.Yorsh@arm.com>

       * gcc.dg/fixed-point/composite-type.c (dg-options): Add
       option -ftrack-macro-expansion=0.
       * gcc.dg/fixed-point/operator-bitwise.c (dg-options): Add
       option -ftrack-macro-expansion=0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187081 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agogcc/testsuite
gretay [Thu, 3 May 2012 08:48:22 +0000 (08:48 +0000)]
gcc/testsuite

2012-05-02  Greta Yorsh  <Greta.Yorsh@arm.com>

* gcc.dg/builtin-stringop-chk-1.c (dg-options): Replace
dg-options for target arm with dg-additional-options.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187079 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-03 Richard Guenther <rguenther@suse.de>
rguenth [Thu, 3 May 2012 08:37:18 +0000 (08:37 +0000)]
2012-05-03  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/53144
* tree-ssa-sccvn.c (vn_reference_lookup_or_insert_constant_for_pieces):
Rename to ...
(vn_reference_lookup_or_insert_for_pieces): ... this.  Properly deal
with SSA name values.
(vn_reference_lookup_3): Adjust callers.

* gcc.dg/torture/pr53144.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187078 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoWith -march=native generate fma3 instruction by default for AMD processors which...
vekumar [Thu, 3 May 2012 07:34:25 +0000 (07:34 +0000)]
With -march=native generate fma3 instruction by default for AMD processors which support both fma and fma4

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187077 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-03 Tobias Burnus <burnus@net-b.de>
burnus [Thu, 3 May 2012 07:18:56 +0000 (07:18 +0000)]
2012-05-03  Tobias Burnus  <burnus@net-b.de>

        PR fortran/52864
        * interface.c (compare_parameter_intent): Remove.
        (check_intents): Remove call, handle CLASS pointer.
        (compare_actual_formal): Handle CLASS pointer.

2012-05-03  Tobias Burnus  <burnus@net-b.de>

        PR fortran/52864
        * gfortran.dg/pointer_intent_7.f90: New.
        * gfortran.dg/pure_formal_3.f90: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187076 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR target/53201
kyukhin [Thu, 3 May 2012 06:50:16 +0000 (06:50 +0000)]
    PR target/53201
        * config/i386/driver-i386.c (host_detect_local_cpu): Add space to
        "-mno-hle".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187075 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR bootstrap/53197
matz [Thu, 3 May 2012 02:32:08 +0000 (02:32 +0000)]
PR bootstrap/53197
* tree-ssa-dse.c (dse_optimize_stmt): Take pointer to
iterator.
(dse_enter_block): Properly iterate the whole sequence even
if the last statement was removed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187074 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoDaily bump.
gccadmin [Thu, 3 May 2012 00:18:18 +0000 (00:18 +0000)]
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187072 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * doc/xml/faq.xml: Update outdated allocator documentation.
redi [Wed, 2 May 2012 23:20:38 +0000 (23:20 +0000)]
* doc/xml/faq.xml: Update outdated allocator documentation.
* doc/xml/manual/allocator.xml: Likewise.
* doc/xml/manual/debug.xml: Likewise.
* doc/xml/manual/evolution.xml: Likewise.
* doc/xml/manual/using.xml: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187068 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-02 Benjamin Kosnik <bkoz@redhat.com>
bkoz [Wed, 2 May 2012 22:25:28 +0000 (22:25 +0000)]
2012-05-02  Benjamin Kosnik  <bkoz@redhat.com>

PR libstdc++/44015
* include/bits/basic_ios.h: Add tparam markup for
* doxygen.  include/bits/basic_string.h: Same.
* include/bits/forward_list.h: Same.
* include/bits/stl_bvector.h: Same.
* include/bits/stl_deque.h: Same.
* include/bits/stl_list.h: Same.  include/bits/stl_map.h:
* Same.  include/bits/stl_multimap.h: Same.
* include/bits/stl_multiset.h: Same.
* include/bits/stl_pair.h: Same.
* include/bits/stl_queue.h: Same.
* include/bits/stl_set.h: Same.
* include/bits/stl_stack.h: Same.
* include/bits/stl_vector.h: Same.
* include/bits/unordered_map.h: Same.
* include/bits/unordered_set.h: Same.  include/std/array:
* Same.  include/std/atomic: Same.  include/std/fstream:
* Same.  include/std/istream: Same.  include/std/ostream:
* Same.  include/std/sstream: Same.
* include/std/streambuf: Same.
* testsuite/23_containers/deque/requirements/dr438/*:
          Adjust line numbers.
* testsuite/23_containers/list/requirements/dr438/*: Same.
* testsuite/23_containers/vector/requirements/dr438/*: Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187066 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/alpha/vms.h (SUBTARGET_OVERRIDE_OPTIONS): For pic code,
steven [Wed, 2 May 2012 22:18:11 +0000 (22:18 +0000)]
* config/alpha/vms.h (SUBTARGET_OVERRIDE_OPTIONS): For pic code,
unset flag_jump_tables.
* stmt.c (expand_case): Remove special flag_pic case conditional
on ASM_OUTPUT_ADDR_DIFF_ELT not being defined.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187065 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-02 Ulrich Weigand <ulrich.weigand@linaro.org>
uweigand [Wed, 2 May 2012 20:56:44 +0000 (20:56 +0000)]
2012-05-02  Ulrich Weigand  <ulrich.weigand@linaro.org>

gcc/
* common/config/s390/s390-common.c (s390_option_optimization_table):
Enable -fsched-pressure using -fsched-pressure-algorithm=model by
default when optimizing.

gcc/testsuite/
* gcc.target/s390/20030123-1.c: Add missing "volatile".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187064 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-02 Martin Jambor <mjambor@suse.cz>
jamborm [Wed, 2 May 2012 19:50:37 +0000 (19:50 +0000)]
2012-05-02  Martin Jambor  <mjambor@suse.cz>

PR lto/52605
* dwarf2out.c (dwarf2out_decl): Only lookup die representing context
of a variable when the contect is a function.

* gcc/testsuite/g++.dg/lto/pr52605_0.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187063 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago* crossconfig.m4: Since we know that all TPF builds are cross-
dj [Wed, 2 May 2012 19:34:31 +0000 (19:34 +0000)]
* crossconfig.m4: Since we know that all TPF builds are cross-
builds and cannot run configuration-time link tests, do not
allow it; just go with known supported linker options.
* configure: Regenerate (called as GLIBCXX_CROSSCONFIG).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187062 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoinclude/
ccoutant [Wed, 2 May 2012 18:41:56 +0000 (18:41 +0000)]
include/

* dwarf2.def: Remove DW_FORM_GNU_ref_index,
replace DW_AT_GNU_ref_base with DW_AT_GNU_ranges_base.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187061 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoProperly initialize cpp_context in destringize_and_run
dodji [Wed, 2 May 2012 16:55:19 +0000 (16:55 +0000)]
Properly initialize cpp_context in destringize_and_run

destringize_and_run forgets to initialize all the fields of the
cpp_context that it pushes.  Later _cpp_pop_context then gets confused
when it accesses context->tokens_kind via the call to macro_of_context
on context->prev.

The first hunk of this patch is the real obvious fix.  The second hunk
is just an assert that I am adding to err on the safe side.

Tested by on x86_64-unknown-linux-gnu against trunk by running the
test gcc.dg/gomp/macro-4.c under Valgrind, and bootstrapped.

libcpp/

* directives.c (destringize_and_run): Properly initialize the new
context.
* macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
the initial base context, which has the same life time as the
current instance of cpp_file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187054 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple.
matz [Wed, 2 May 2012 16:41:48 +0000 (16:41 +0000)]
* coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple.
* gimple.h (struct gimple_seq_node_d, struct gimple_seq_d): Remove.
(const_gimple_seq_node): Remove.
(gimple_seq_node): Typedef as gimple.
(struct gimple_statement_base): Add next and prev members,
adjust all WORD markers in using structs.
(union gimple_statement_d): Link via gsbase.next field for GC and PCH.
(gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
gimple_seq_last_stmt): Adjust as gimple_seq, gimple_seq_node and
gimple are the same.
(gimple_seq_set_last, gimple_seq_set_first): Don't allocate
gimple_seq, adjust.
(gimple_init_singleton): New function.
(gsi_start_1, gsi_last_1, gsi_end_p, gsi_one_before_end_p): Adjust.
(gsi_next, gsi_prev): Adjust, handle prev cyclic list correctly.
(gsi_stmt): Adjust.
(gsi_stmt_ptr): Remove.
(enum gimple_alloc_kind): Remove gimple_alloc_kind_seq member.

* gimple-iterator.c (update_bb_for_stmts): Take last parameter
again, adjust for above changes.
(update_call_edge_frequencies): Adjust for above changes.
(gsi_insert_seq_nodes_before): Rewrite for new data structure.
(gsi_insert_seq_nodes_after): Ditto.
(gsi_split_seq_after): Ditto.
(gsi_set_stmt): Ditto.
(gsi_split_seq_before): Ditto.
(gsi_remove): Ditto.
(gsi_insert_seq_before_without_update): Don't free sequence.
(gsi_insert_seq_after_without_update): Ditto.
(gsi_replace): Assert some more invariants.
(gsi_insert_before_without_update, gsi_insert_after_without_update):
Tidy.
(gsi_for_stmt): Don't search for stmt.
(gsi_insert_on_edge_immediate): Tidy.

* gimple.c (gimple_alloc_k): Remove "sequences".
(gimple_seq_cache): Remove.
(gimple_alloc_stat): Make stmt a singleton sequence.
(gimple_seq_alloc, gimple_seq_free): Remove.
(gimple_assign_set_rhs_with_ops_1): Ensure new stmt is a singleton.
(gimple_copy): Ditto.
* gimplify.c (gimplify_cleanup_point_expr): Use gsi_set_stmt,
create iterator from correct sequence.
* tree-phinodes.c (make_phi_node): Make stmt a singleton.

* gimple.h (gimple_stmt_iterator <seq>): Make it be pointer to
gimple_seq.
(gimple_seq_set_last, gimple_seq_set_first): Take pointer to
sequence, lazily allocate it.
(bb_seq_addr): New function.
(gsi_start_1): Rename from gsi_start, but take pointer to sequence.
(gsi_start): Macro to wrap gsi_start_1 taking pointer of argument.
(gsi_none): New function.
(gsi_start_bb): Adjust.
(gsi_last_1): Rename from gsi_last, but take pointer to sequence.
(gsi_last): Macro to wrap gsi_last_1 taking pointer of argument.
(gsi_last_bb): Adjust.
(gsi_seq): Adjust.
* tree-flow-inline.h (phi_nodes_ptr): New function.

* gimple-iterator.c (gsi_insert_seq_nodes_before): Adjust to
datastructure and interface change.
(gsi_insert_seq_before_without_update): Ditto.
(gsi_insert_seq_nodes_after): Ditto.
(gsi_insert_seq_after_without_update): Ditto.
(gsi_split_seq_after): Ditto, don't use gimple_seq_alloc.
(gsi_split_seq_before): Ditto.
(gsi_start_phis): Adjust.
* tree-vect-loop.c (vect_determine_vectorization_factor): Use
gsi_none.
(vect_transform_loop): Ditto.
* gimple.c (gimple_seq_add_stmt, gimple_seq_add_seq,
gimple_seq_copy): Don't use gimple_seq_alloc.
* gimplify.c (gimple_seq_add_stmt_without_update): Ditto.
(gimplify_seq_add_seq): Ditto.
* lto-streamer-in.c (make_new_block): Ditto.
* tree-cfg.c (create_bb): Ditto.
* tree-sra.c (initialize_parameter_reductions): Ditto.

* gimple.h (gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
gimple_seq_last_stmt, gimple_seq_set_last, gimple_seq_set_first,
gimple_seq_empty_p, gimple_seq_alloc_with_stmt, bb_seq,
set_bb_seq): Move down to after gimple_statement_d definition.

* gimple-fold.c (gimplify_and_update_call_from_tree): Use
gsi_replace_with_seq, instead of inserting itself.
* gimple-iterator.c (gsi_replace_with_seq): New function.
* tree-ssa-forwprop.c (forward_propagate_comparison): Take
iterator instead of statement, advance it.
(ssa_forward_propagate_and_combine): Adjust call to above.

* tree-phinodes.c (add_phi_node_to_bb): Tidy, don't use
gimple_seq_alloc.
* omp-low.c (finalize_task_copyfn): Don't use gimple_seq_alloc.
* tree-nested.c (walk_gimple_omp_for): Ditto.
* trans-mem.c (lower_transaction): Ditto.
* tree-eh.c (do_return_redirection): Ditto.
(do_goto_redirection): Ditto.
(lower_try_finally_switch): Ditto.
* gimplify.c (gimplify_stmt): Ditto.
(gimplify_scan_omp_clauses): Ditto.
(gimplify_omp_for): Ditto.
(gimplify_function_tree): Ditto.
* gimple-fold.c (gimplify_and_update_call_from_tree): Ditto.
* tree-mudflap.c (mf_decl_cache_locals): Ditto.
(mf_build_check_statement_for): Ditto.
(mx_register_decls): Ditto.
* graphite-sese-to-poly.c (remove_invariant_phi): Ditto,
and don't use itertors to append.
(insert_stmts): Ditto.
(insert_out_of_ssa_copy): Ditto.
(insert_out_of_ssa_copy_on_edge): Ditto.

* gimple.h (gimple_bind_body_ptr): New function.
(gimple_bind_body): Use it.
(gimple_catch_handler): Use gimple_catch_handler_ptr.
(gimple_eh_filter_failure_ptr): New function.
(gimple_eh_filter_failure): Use it.
(gimple_eh_else_n_body_ptr): New function.
(gimple_eh_else_n_body): Use it.
(gimple_eh_else_e_body_ptr): New function.
(gimple_eh_else_e_body): Use it.
(gimple_try_eval_ptr): New function.
(gimple_try_eval): Use it.
(gimple_try_cleanup_ptr): New function.
(gimple_try_cleanup): Use it.
(gimple_wce_cleanup_ptr): New function.
(gimple_wce_cleanup): Use it.
(gimple_omp_body_ptr): New function.
(gimple_omp_body): Use it.
(gimple_omp_for_pre_body_ptr): New function.
(gimple_omp_for_pre_body): Use it.
(gimple_transaction_body_ptr): New function.
(gimple_transaction_body): Use it.
(gsi_split_seq_before): Adjust to return nothing and take pointer
to sequence.
(gsi_set_stmt): Declare.
(gsi_replace_with_seq): Declare.
(walk_gimple_seq_mod): Declare.
* function.h (struct function <gimple_body>): Use typedef gimple_seq.

* gimple-iterator.c (gsi_set_stmt): New function.
(gsi_split_seq_before): Return new sequence via pointer argument.
(gsi_replace): Use gsi_set_stmt.

* tree-ssa-loop-im.c (move_computations_stmt): First remove
then insert stmt.
* tree-complex.c (update_complex_components_on_edge): Don't
copy gsi.
* tree-phinodes.c (resize_phi_node): Don't resize stmt in-place,
return new stmt.
(reserve_phi_args_for_new_edge): Change call to above,
use gsi_set_stmt.

* omp-low.c (lower_omp): Change prototype to take pointer to
sequence.
(lower_rec_input_clauses): Use gimple_seq_add_seq instead of
iterators.  Adjust call to lower_omp.
(lower_lastprivate_clauses): Adjust call to lower_omp.
(lower_reduction_clauses): Ditto.
(expand_omp_taskreg): Nullify non-cfg body of child_fn.
(lower_omp_sections): Don't explicitely count sequence length,
nullify lowered bodies earlier, ensure stmts are part of only
one sequence, adjust call to lower_omp.
(lower_omp_single): Ensure stmts are part of only one sequence,
adjust call to lower_omp.
(lower_omp_master): Ditto.
(lower_omp_ordered): Ditto.
(lower_omp_critical): Ditto.
(lower_omp_for): Ditto.
(lower_omp_taskreg): Ditto, tidy.
(lower_omp_1): Adjust calls to lower_omp.
(execute_lower_omp): Ditto.
(lower_omp): Adjust to take pointer to sequence.
(diagnose_sb_2): Use walk_gimple_seq_mod.
(diagnose_omp_structured_block_errors): Ditto and set possibly
changed function body.
* gimple-low.c (lower_function_body): Set function body after
it stabilizes.
(lower_sequence): Adjust to take pointer to sequence.
(lower_omp_directive): Ensure stmt isn't put twice into the
sequence, adjust call to lower_sequence.
(lower_stmt): Adjust calls to lower_sequence.
(lower_gimple_bind): Ditto.
(gimple_try_catch_may_fallthru): Call gsi_start with lvalue.
* tree-nested.c (walk_body): Take pointer to sequence, use
walk_gimple_seq_mod.
(walk_function): Adjust call to walk_body, set possibly changed
body.
(walk_gimple_omp_for): Adjust calls to walk_body.
(convert_nonlocal_omp_clauses): Ditto.
(convert_nonlocal_reference_stmt): Ditto.
(convert_local_omp_clauses): Ditto.
(convert_local_reference_stmt): Ditto.
(convert_tramp_reference_stmt): Ditto.
(convert_gimple_call): Ditto.
(convert_nl_goto_reference): Use local iterator copy.
* gimple.c (walk_gimple_seq_mod): Renamed from walk_gimple_seq,
but taking pointer to sequence, ensure gsi_start is called with
callers lvalue.
(walk_gimple_seq): New wrapper around walk_gimple_seq_mod,
asserting that the sequence head didn't change.
(walk_gimple_stmt): Replace all calls to walk_gimple_seq with
walk_gimple_seq_mod.
* trans-mem.c (lower_transaction): Use walk_gimple_seq_mod.
(execute_lower_tm): Ditto, and set possibly changed body.
* tree-eh.c (lower_eh_constructs_1): Take pointer to sequence,
call gsi_start with that lvalue.
(replace_goto_queue_stmt_list): Ditto.
(replace_goto_queue_1): Adjust calls to replace_goto_queue_stmt_list.
(replace_goto_queue): Ditto.
(lower_try_finally_nofallthru): Adjust calls to lower_eh_constructs_1.
(lower_try_finally_onedest): Ditto.
(lower_try_finally_copy): Ditto.
(lower_try_finally_switch): Ditto.
(lower_try_finally): Ditto.
(lower_eh_filter): Ditto.
(lower_eh_must_not_throw): Ditto.
(lower_cleanup): Ditto.
(lower_eh_constructs_2): Ditto.
(lower_catch): Ditto, and ensure gsi_start is called with lvalue.
(lower_eh_constructs): Adjust calls to lower_eh_constructs_1, and
set possibly changed body.
(optimize_double_finally): Call gsi_start with lvalue.

* tree-cfg.c (make_blocks): Adjust call to gsi_split_seq_before.
(gimple_split_block): Ditto.
(gimple_merge_blocks): Use gsi_start_phis.
(move_stmt_r): Use walk_gimple_seq_mod.
* tree-ssa-dse.c (dse_enter_block): Use gsi_last_bb.
* cgraphbuild.c (build_cgraph_edges): Use gsi_start_phis.
(rebuild_cgraph_edges): Ditto.
(cgraph_rebuild_references): Ditto.
* ipa-prop.c (ipa_analyze_params_uses): Ditto.
* tree-inline.c (copy_phis_for_bb): Ditto.
* tree-ssa-dce.c: Ditto.

* cgraphunit.c (cgraph_analyze_function): Use gimple_has_body_p.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187053 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-02 Benjamin Kosnik <bkoz@redhat.com>
bkoz [Wed, 2 May 2012 16:22:06 +0000 (16:22 +0000)]
2012-05-02  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/hashtable_policy.h: Correct namepace nesting for
_Hashtable forward declaration.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187052 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoChangeLog entry:
kyukhin [Wed, 2 May 2012 15:32:01 +0000 (15:32 +0000)]
ChangeLog entry:

        * coretypes (MEMMODEL_MASK): New.
        * builtins.c (get_memmodel): Add val. Call target.memmodel_check
        and return new variable.
        (expand_builtin_atomic_exchange):  Mask memmodel values.
        (expand_builtin_atomic_compare_exchange): Ditto.
        (expand_builtin_atomic_load): Ditto.
        (expand_builtin_atomic_store): Ditto.
        (expand_builtin_atomic_clear): Ditto.
        * doc/extend.texi: Mention port-dependent memory model flags.
        * config/i386/cpuid.h (bit_HLE): New.
        * config/i386/driver-i386.c (host_detect_local_cpu): Detect
        HLE support.
        * config/i386/i386-protos.h (ix86_generate_hle_prefix): New.
        * config/i386/i386-c.c (ix86_target_macros_internal): Set
        HLE defines.
        (ix86_target_string)<-mhle>: New.
        (ix86_valid_target_attribute_inner_p)<OPT_mhle>: Ditto.
        * config/i386/i386.c (ix86_target_string)<OPTION_MASK_ISA_HLE>:
        New.
        (ix86_valid_target_attribute_inner_p)<OPT_mhle>: Ditto.
        (ix86_option_override_internal)<PTA_HLE>: New switch, set it
        enabled for generic, generic64 and core-avx2.
        (ix86_print_operand): Generate HLE lock prefixes.
        (ix86_memmodel_check): New.
        (TARGET_MEMMODEL_CHECK): Ditto.
        * config/i386/i386.h (OPTION_ISA_HLE): Ditto.
        (IX86_HLE_ACQUIRE): Ditto.
        (IX86_HLE_RELEASE): Ditto.
        * config/i386/i386.h (ix86_generate_hle_prefix): Ditto.
        * config/i386/i386.opt (mhle): Ditto.
        * config/i386/sync.md(atomic_compare_and_swap<mode>): Pass
        success model to instruction emitter.
        (atomic_fetch_add<mode>): Ditto.
        (atomic_exchange<mode>): Ditto.
        (atomic_add<mode>): Ditto.
        (atomic_sub<mode>): Ditto.
        (atomic_<code><mode>): Ditto.
        (*atomic_compare_and_swap_doubledi_pic): Ditto.
        (atomic_compare_and_swap_single<mode>): Define and use argument
        for success model.
        (atomic_compare_and_swap_double<mode>): Ditto.
        * configure.ac: Check if assembler support HLE prefixes.
        * configure: Regenerate.
        * config.in: Ditto.

testsuite/ChangeLog entry:

        * gcc.target/i386/hle-cmpxchg-acq-1.c: New.
        * gcc.target/i386/hle-cmpxchg-rel-1.c: Ditto.
        * gcc.target/i386/hle-add-acq-1.c: Ditto.
        * gcc.target/i386/hle-add-rel-1.c: Ditto.
        * gcc.target/i386/hle-and-acq-1.c: Ditto.
        * gcc.target/i386/hle-and-rel-1.c: Ditto.
        * gcc.target/i386/hle-or-acq-1.c: Ditto.
        * gcc.target/i386/hle-or-rel-1.c: Ditto.
        * gcc.target/i386/hle-sub-acq-1.c: Ditto.
        * gcc.target/i386/hle-sub-rel-1.c: Ditto.
        * gcc.target/i386/hle-xadd-acq-1.c: Ditto.
        * gcc.target/i386/hle-xadd-rel-1.c: Ditto.
        * gcc.target/i386/hle-xchg-acq-1.c: Ditto.
        * gcc.target/i386/hle-xchg-rel-1.c: Ditto.
        * gcc.target/i386/hle-xor-acq-1.c: Ditto.
        * gcc.target/i386/hle-xor-rel-1.c: Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187051 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agogcc/
steven [Wed, 2 May 2012 12:57:10 +0000 (12:57 +0000)]
gcc/
PR middle-end/53153
* gimplify.c (preprocess_case_label_vec_for_gimple): New function,
split out from ...
(gimplify_switch_expr): ... here.
* gimple.h (preprocess_case_label_vec_for_gimple): Add prototype.
* tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): New function
to clean up case labels with values outside the index type range.
(simplify_gimple_switch): Call it if something changed.
Remove strange and unnecessary assert.

testsuite/
PR middle-end/53153
* gcc.dg/pr53153.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187048 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agogcc/ada/
charlet [Wed, 2 May 2012 12:56:11 +0000 (12:56 +0000)]
gcc/ada/

2012-05-02  Pascal Obry  <obry@adacore.com>

Revert 2012-02-24  Dave Korn  <dave.korn.cygwin@gmail.com>

libada/

2012-05-02  Pascal Obry  <obry@adacore.com>

Revert 2012-02-24  Dave Korn  <dave.korn.cygwin@gmail.com>

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187047 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-02 Richard Guenther <rguenther@suse.de>
rguenth [Wed, 2 May 2012 11:22:31 +0000 (11:22 +0000)]
2012-05-02  Richard Guenther  <rguenther@suse.de>

* tree.c (valid_constant_size_p): New function.
* tree.h (valid_constant_size_p): Declare.
* cfgexpand.c (expand_one_var): Adjust check for too large
variables by using valid_constant_size_p.
* varasm.c (assemble_variable): Likewise.

c/
* c-decl.c (grokdeclarator): Properly check for sizes that
cover more than half of the address-space.

cp/
* decl.c (grokdeclarator): Properly check for sizes that
cover more than half of the address-space.

2012-05-02  Richard Guenther  <rguenther@suse.de>

* fold-const.c (div_if_zero_remainder): sizetypes no longer
sign-extend.
(int_const_binop_1): New worker for int_const_binop with
overflowable parameter.  Pass it through
to force_fit_type_double.
(int_const_binop): Wrap around int_const_binop_1 with overflowable
equal to one.
(size_binop_loc): Call int_const_binop_1 with overflowable equal
to minus one, forcing overflow detection for even unsigned types.
(extract_muldiv_1): Remove bogus TYPE_IS_SIZETYPE special-casing.
(fold_binary_loc): Call try_move_mult_to_index with signed offset.
* stor-layout.c (initialize_sizetypes): sizetypes no longer
sign-extend.
(layout_type): For zero-sized arrays ignore overflow on the
size calculations.
* tree-ssa-ccp.c (bit_value_unop_1): Likewise.
(bit_value_binop_1): Likewise.
* tree.c (double_int_to_tree): Likewise.
(double_int_fits_to_tree_p): Likewise.
(force_fit_type_double): Likewise.
(host_integerp): Likewise.
(int_fits_type_p): Likewise.
* varasm.c (output_constructor_regular_field): Sign-extend the
field-offset to cater for negative offsets produced by the Ada frontend.
* omp-low.c (extract_omp_for_data): Convert the loop step to
signed for pointer adjustments.

* g++.dg/tree-ssa/pr19807.C: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187042 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR tree-optimization/53163
jakub [Wed, 2 May 2012 09:55:32 +0000 (09:55 +0000)]
PR tree-optimization/53163
* tree-ssa-phiopt.c (cond_if_else_store_replacement): Don't ignore
return value from compute_all_dependences.

* gcc.c-torture/compile/pr53163.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187038 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR rtl-optimization/53160
jakub [Wed, 2 May 2012 07:13:49 +0000 (07:13 +0000)]
PR rtl-optimization/53160
* ree.c (combine_reaching_defs): Handle the case where cand->insn
has been modified by ree pass already.

* gcc.c-torture/execute/pr53160.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187035 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoDaily bump.
gccadmin [Wed, 2 May 2012 00:18:21 +0000 (00:18 +0000)]
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187034 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agogcc/:
ian [Tue, 1 May 2012 21:25:15 +0000 (21:25 +0000)]
gcc/:
PR c/37303
* c-decl.c (build_compound_literal): Make the decl readonly if it
an array of a readonly type.
* gimplify.c (gimplify_compound_literal_expr): Add fallback
parameter.  Change all callers.  If the decl is not addressable
and is not an l-value, make it readonly.
gcc/testsuite:
PR c/37303
* gcc.dg/pr37303.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187027 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-01 François Dumont <fdumont@gcc.gnu.org>
fdumont [Tue, 1 May 2012 20:29:16 +0000 (20:29 +0000)]
2012-05-01  François Dumont  <fdumont@gcc.gnu.org>

PR libstdc++/53115
* include/bits/hashtable.h
(_Hashtable<>::_M_rehash_aux(size_type, false_type)): Fix buckets
after insertion of several equivalent elements.
* testsuite/23_containers/unordered_multiset/insert/53115.cc: New.
* testsuite/23_containers/unordered_multimap/insert/53115.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187025 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * ira.c (allocated_reg_info_size): New static variable.
bernds [Tue, 1 May 2012 16:34:26 +0000 (16:34 +0000)]
* ira.c (allocated_reg_info_size): New static variable.
(expand_reg_info): Manage it. Call
setup_preferred_alternate_classes_for_new_pseudos.
(ira): Don't do it here.  Remove local allocated_reg_info_size,
set the global before calling find_moveable_pseudos.
(find_moveable_pseudos): Call expand_reg_info rather than
resize_reg_info.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187019 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoAdd libatomic as a target library.
rth [Tue, 1 May 2012 15:48:28 +0000 (15:48 +0000)]
Add libatomic as a target library.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187018 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoAdd -fno-sync-libcalls.
rth [Tue, 1 May 2012 15:48:10 +0000 (15:48 +0000)]
Add -fno-sync-libcalls.

        * common.opt (fsync-libcalls): New.
        * doc/invoke.texi: Document it.
        * optabs.c (init_sync_libfuncs): Honor it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187017 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago* lib/target-supports.exp
rth [Tue, 1 May 2012 15:47:59 +0000 (15:47 +0000)]
* lib/target-supports.exp
        (check_effective_target_sync_long_long_runtime): True for
        check_effective_target_powerpc64.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187016 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agogcc/
rsandifo [Tue, 1 May 2012 14:45:24 +0000 (14:45 +0000)]
gcc/
2012-03-31  Kenneth Zadeck  <zadeck@naturalbridge.com>
    Richard Sandiford  <r.sandiford@uk.ibm.com>

* Makefile.in (lower-subreg.o, target-globals.o): Depend on
lower-subreg.h.
* lower-subreg.h: New file.
* target-globals.h (this_target_lower_subreg): Declare.
(target_globals): Add lower_subreg;
(restore_target_globals): Restore this_target_lower_subreg.
* target-globals.c: Include it.
(default_target_globals): Add default_target_lower_subreg.
(save_target_globals): Initialize target_lower_subreg.
* rtl.h (init_lower_subreg): Added declaration.
* toplev.c (backend_init_target): Call initializer for lower-subreg
pass.
* lower-subreg.c (LOG_COSTS, FORCE_LOWERING): New macros.
(default_target_lower_subreg): New variable.
(this_target_lower_subreg): Likewise.
(twice_word_mode, choices): New macros.
(shift_cost, compute_splitting_shift, compute_costs)
(init_lower_subreg): New functions.
(resolve_simple_move): Add speed_p argument.  Check choices.
(find_pseudo_copy): Don't check the mode size here.
(resolve_simple_move): Assert the mode size.
(find_decomposable_shift_zext): Add speed_p argument and return
a bool.  Check choices.
(resolve_shift_zext): Add comment.
(dump_shift_choices, dump_choices): New functions.
(decompose_multiword_subregs): Dump list of profitable
transformations.  Add code to skip non profitable transformations.
Update calls to simple_move and find_decomposable_shift_zext.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187015 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-01 Ian Bolton <ian.bolton@arm.com>
gretay [Tue, 1 May 2012 14:37:25 +0000 (14:37 +0000)]
2012-05-01  Ian Bolton  <ian.bolton@arm.com>
            Sameera Deshpande  <sameera.deshpande@arm.com>
            Greta Yorsh  <greta.yorsh@arm.com>

* config/arm/arm-protos.h (thumb_unexpanded_epilogue): Rename to...
        (thumb1_unexpanded_epilogue): ...this.
* config/arm/arm.c (thumb_unexpanded_epilogue): Rename to...
        (thumb1_unexpanded_epilogue): ...this.
* config/arm/arm.md (thumb_unexpanded_epilogue): Rename to...
        (thumb1_unexpanded_epilogue): ...this.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187014 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-05-01 Greta Yorsh <Greta.Yorsh@arm.com>
gretay [Tue, 1 May 2012 12:25:33 +0000 (12:25 +0000)]
2012-05-01  Greta Yorsh  <Greta.Yorsh@arm.com>

* MAINTAINERS (Write After Approval): Add myself.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187013 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_DEFAULT): Avoid ifdef
rearnsha [Tue, 1 May 2012 08:47:43 +0000 (08:47 +0000)]
* arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_DEFAULT): Avoid ifdef
comparing enumeration values.  Update comments.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187012 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR target/53038
amodra [Tue, 1 May 2012 04:03:21 +0000 (04:03 +0000)]
PR target/53038
* config/rs6000/rs6000.c (load_lr_save, restore_saved_lr,
load_cr_save, add_crlr_cfa_restore): New functions.
(rs6000_restore_saved_cr): Rename to..
(restore_saved_cr): ..this.  Add cfa_restore notes for cr.
(rs6000_emit_epilogue): Use new functions.  Adjust condition
for emitting lr and cr cfa_restore.  Emit cfa_restores for fp
regs when using out-of-line restore only when shrink wrapping.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187010 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoDaily bump.
gccadmin [Tue, 1 May 2012 00:19:11 +0000 (00:19 +0000)]
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187007 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR middle-end/53136
uros [Mon, 30 Apr 2012 21:34:35 +0000 (21:34 +0000)]
PR middle-end/53136
* ipa-prop.c (ipa_print_node_jump_functions): Wrap multiple
calls to cgraph_node_name in xstrdup.
(ipa_make_edge_direct_to_target): Ditto.
* cgraph.c (dump_cgraph_node): Ditto.
* tree-sra.c (convert_callers_for_node): Ditto.
* lto-symtab.c (lto_cgraph_replace_node): Ditto.
* ipa-cp.c (perhaps_add_new_callers): Ditto.
* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Ditto.
(cgraph_materialize_all_clones): Ditto.
* ipa-inline.c (report_inline_failed_reason): Ditto.
(want_early_inline_function_p): Ditto.
(edge_badness): Ditto.
(update_edge_key): Ditto.
(flatten_function): Ditto.
(ipa_inline): Ditto.
(inlinw_always_inline_functions): Ditto.
(early_inline_small_functions): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187001 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR target/53141
uros [Mon, 30 Apr 2012 21:30:06 +0000 (21:30 +0000)]
PR target/53141
* config/i386/i386.md (*umul<mode><dwi>3_1): Switch places of
constraints 0 and 1.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187000 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c
hubicka [Mon, 30 Apr 2012 17:55:29 +0000 (17:55 +0000)]
* cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c
(cgraph_asm_nodes, cgraph_asm_last_node): Move to cgraphunit.c
(cgraph_add_to_same_comdat_group): Remove.
(cgraph_add_asm_node): Move to cgraphunit.c.
(cgraph_make_decl_local): Move to symtab.c
(cgraph_make_node_local_1): Update.
(cgraph_can_remove_if_no_direct_calls_and): Update.
(used_from_object_file_p): Update.
(resolution_used_from_other_file_p): Move to symtab.c
(cgraph_used_from_object_file_p): move to symtab.c
(verify_cgraph_node): Verify same comdat groups.
* cgraph.h (cgraph_asm_node): Rename to ...
(asm_node): ... this one.
(cgraph_asm_nodes): Rename to ...
(asm_nodes): ... this one.
(symtab_add_to_same_comdat_group): New function.
(symtab_dissolve_same_comdat_group_list): New function.
(symtab_used_from_object_file_p): Declare.
(symtab_make_decl_local): Declare.
(cgraph_add_to_same_comdat_group): Remove.
(cgraph_add_asm_node): Remove.
(cgraph_used_from_object_file_p, varpool_used_from_object_file_p):
Remove.
(cgraph_finalize_compilation_unit): Rename to ...
(finalize_compilation_unit): ... this one.
(cgraph_optimize): Rename to ....
(compile): ... this one.
(add_asm_node): Declare.
(fixup_same_cpp_alias_visibility): Declare.
(cgraph_make_decl_local): Remove.
(varpool_assemble_pending_decls): Rename to ...
(varpool_output_variables): ... this one.
(varpool_remove_unreferenced_decls): Remove.
* ipa-inline-transform.c (clone_inlined_nodes): Dissolve comdat groups.
(preserve_function_body_p): Make static.
* toplev.c (compile_file): Update comments;
update.
* cgraphunit.c: Update comments.
(cgraph_expand_all_functions): Rename to ...
(expand_all_functions): ... this one; update.
(cgraph_mark_functions_to_output): Rename to ...
(mark_functions_to_output): ... this one; cleanup.
(cgraph_output_pending_asms): Remove prototype.
(asm_nodes, asm_last_node): New static vars.
(cgraph_process_new_functions): Update.
(cgraph_reset_node): Cleanup; add comment.
(cgraph_add_new_function): Update.
(cgraph_output_pending_asms): Rename to ...
(output_asm_statements): ... this one.
(add_asm_node): New function.
(fixup_same_cpp_alias_visibility): New function based on code
in cgraph_analyze_function.
(cgraph_analyze_function): Use it.
(cgraph_order_sort): Update.
(cgraph_output_in_order): Update.
(cgraph_function_versioning): Update.
(cgraph_optimize): Rename to ...
(compile): ... this one; initialize streamer hooks here.
(cgraph_finalize_compilation_unit): Rename to ...
(finalize_compilation_unit): ... this one; do not initialize streamer
hook here.
* lto-streamer-out.c (lto_output_toplevel_asms): Update.
* dwarf2out.c: Update ocmment.
* optimize.c (maybe_clone_body): Use symtab_add_to_same_comdat_group.
* method.c (use_thunk): Likewise.
* semantics.c (maybe_add_lambda_conv_op): Likewise.
* decl2.c (maybe_emit_vtables): Likewise.
(cp_write_global_declarations): Use finalize_compilation_unit.
* parser.c (cp_parser_asm_definition): Use add_asm_node.
* lto-streamer-in.c (lto_input_toplevel_asms): Use add_asm_node
* c-decl.c (c_write_global_declarations): Use finalize_compilation_unit.
* langhooks.c (write_global_declarations): Update.
* ipa.c (cgraph_externally_visible_p): Update.
(dissolve_same_comdat_group_list): Remove.
(function_and_variable_visibility): Update.
* symtab.c: Inlcude lto-streamer.h and rtl.h
(ld_plugin_symbol_resolution_names): New.
(symtab_add_to_same_comdat_group): New.
(symtab_dissolve_same_comdat_group_list): New.
(resolution_used_from_other_file_p): Move here from cgraph.c
(symtab_used_from_object_file_p): New.
(symtab_make_decl_local): New.
* passes.c (register_pass): Update comments.
* c-parser.c (c_parser_asm_definition): Update.
* varpool.c (varpool_analyze_node): Use fixup_same_cpp_alias_visibility.
(varpool_remove_unreferenced_decls): Make static.
(varpool_assemble_pending_decls): Rename to ...
(varpool_output_variables): ... this one; call
varpool_remove_unreferenced_decls.
(varpool_used_from_object_file_p): Remove.

* gogo-tree.cc (Gogo::write_globals): Use finalize_compilation_unit.

* gcc-interface/utils.c (rest_of_subprog_body_compilation): Update
comment.
(gnat_write_global_declarations): Use finalize_compilation_unit.

* f95-lang.c (gfc_finish): Update comments.

* lto.c (lto_main): Use compile ().
* lto-partition.c (partition_cgraph_node_p): Use symtab_used_from_object_file_p.
(partition_varpool_node_p): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186998 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR c++/51033
jason [Mon, 30 Apr 2012 17:23:28 +0000 (17:23 +0000)]
PR c++/51033
gcc/
* c-typeck.c (build_array_ref): Call
convert_vector_to_pointer_for_subscript.
gcc/c-family
* c-common.c (convert_vector_to_pointer_for_subscript): New function.
* c-common.h (convert_vector_to_pointer_for_subscript): Declare it.
gcc/cp/
* typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
* decl2.c (grok_array_decl): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186994 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/i386/i386.md (and<mode>3): Change runtime operand mode checks
uros [Mon, 30 Apr 2012 17:12:42 +0000 (17:12 +0000)]
* config/i386/i386.md (and<mode>3): Change runtime operand mode checks
to compile-time "mode == <MODE>mode" checks.
(and splitter): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186993 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * libcpp/ChangeLog: Fix PR number.
manu [Mon, 30 Apr 2012 17:03:02 +0000 (17:03 +0000)]
 * libcpp/ChangeLog: Fix PR number.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186992 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
manu [Mon, 30 Apr 2012 16:57:22 +0000 (16:57 +0000)]
2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
    Dodji Seketeli  <dodji@seketeli.org>

PR c++/52974
* libcpp/files.c (maybe_shorter_path): New.
(find_file_in_dir): Use it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186991 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/arm/arm.md (UNSPEC_LL): New.
rth [Mon, 30 Apr 2012 16:51:15 +0000 (16:51 +0000)]
    * config/arm/arm.md (UNSPEC_LL): New.
        * config/arm/sync.md (atomic_loaddi, atomic_loaddi_1): New.
        (arm_load_exclusivedi): Use %H0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186990 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * dwarf2out.c (comdat_symbol_id): Add const.
jason [Mon, 30 Apr 2012 16:50:24 +0000 (16:50 +0000)]
* dwarf2out.c (comdat_symbol_id): Add const.
(union die_symbol_or_type_node): Add const to die_symbol.
(output_die_symbol, output_die, output_comp_unit): Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186989 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR c++/51314
jason [Mon, 30 Apr 2012 16:36:37 +0000 (16:36 +0000)]
PR c++/51314
* parser.c (cp_parser_sizeof_operand): Require parentheses for
sizeof...

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186988 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago PR go/52586
ian [Mon, 30 Apr 2012 16:04:17 +0000 (16:04 +0000)]
PR go/52586
mksysinfo, syscall: Make sure SYS_GETDENTS64 is defined.

Fixes build on MIPS GNU/Linux.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186986 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix failure in gcc.dg/pr52283.c by adding the missing
belagod [Mon, 30 Apr 2012 13:56:51 +0000 (13:56 +0000)]
Fix failure in gcc.dg/pr52283.c by adding the missing
dg-warning and dg-options.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186985 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-30 Andrew Stubbs <ams@codesourcery.com>
ams [Mon, 30 Apr 2012 13:52:16 +0000 (13:52 +0000)]
2012-04-30  Andrew Stubbs  <ams@codesourcery.com>

* config/arm/arm.md (negdi2): Use gen_negdi2_neon.
* config/arm/neon.md (negdi2_neon): New insn.
Also add splitters for core and NEON registers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186984 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-30 Andrew Stubbs <ams@codesourcery.com>
ams [Mon, 30 Apr 2012 13:52:07 +0000 (13:52 +0000)]
2012-04-30  Andrew Stubbs  <ams@codesourcery.com>

* config/arm/arm.c (neon_valid_immediate): Allow const_int.
(arm_print_operand): Add 'x' format.
* config/arm/constraints.md (Dn): Allow const_int.
* config/arm/neon.md (neon_mov<mode>): Use VDX to allow DImode.
Use 'x' format to print constants.
* config/arm/predicates.md (imm_for_neon_mov_operand): Allow const_int.
* config/arm/vfp.md (movdi_vfp): Disable for const_int when neon
is enabled.
(movdi_vfp_cortexa8): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186983 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix email addresses
rearnsha [Mon, 30 Apr 2012 13:42:43 +0000 (13:42 +0000)]
Fix email addresses

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186982 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-24 Ian Bolton <ian.bolton at arm.com>
rearnsha [Mon, 30 Apr 2012 13:41:49 +0000 (13:41 +0000)]
2012-04-24  Ian Bolton  <ian.bolton at arm.com>
            Sameera Deshpande  <sameera.deshpande at arm.com>
            Greta Yorsh  <greta.yorsh at arm.com>

        * config/arm/arm-protos.h (ldm_stm_operation_p): New parameters.
        * config/arm/arm.c (ldm_stm_operation_p): New parameters.
        * config/arm/predicates.md (load_multiple_operation): Add arguments.
        (store_multiple_operation): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186981 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-30 Ian Bolton <ian.bolton at arm.com>
rearnsha [Mon, 30 Apr 2012 13:40:14 +0000 (13:40 +0000)]
2012-04-30  Ian Bolton <ian.bolton at arm.com>
    Sameera Deshpande  <sameera.deshpande at arm.com>
    Greta Yorsh  <greta.yorsh at arm.com>

* config/arm/arm-protos.h (ldm_stm_operation_p): New declaration.
* config/arm/arm.c (ldm_stm_operation_p): New function.
* config/arm/predicates.md (load_multiple_operation): Update predicate.
(store_multiple_operation): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186980 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/i386/i386.md (and<mode>3): Expand masking operations with
uros [Mon, 30 Apr 2012 12:59:44 +0000 (12:59 +0000)]
* config/i386/i386.md (and<mode>3): Expand masking operations with
0xff, 0xffff or 0xffffffff immediates to corresponding zero_extend RTX.
(and splitter): Split to DImode zero_extend RTX for DImode operand[0].

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186979 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoAdd -Wvarargs option
dodji [Mon, 30 Apr 2012 11:43:57 +0000 (11:43 +0000)]
Add -Wvarargs option

Several warnings related to questionable usage cases of variadic
function related macros (like va_start) could not be controlled by any
warning-related macro.  Fixed thus, by introducing the -Wvarargs
option.

Tested on x86_64-unknown-linux-gnu against trunk.

gcc/c-family/

* c.opt (Wvarargs):  Define new option.

gcc/
* builtins.c (fold_builtin_next_arg):  Use OPT_Wvarargs as an
argument for the various warning_at calls.

gcc/doc/

* invoke.texi: Update the documentation.

gcc/testsuite/

* c-c++-common/Wvarargs.c: New test case.
* c-c++-common/Wvarargs-2.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186978 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoSwitch -ftrack-macro-expansion=2 on by default.
dodji [Mon, 30 Apr 2012 11:43:43 +0000 (11:43 +0000)]
Switch -ftrack-macro-expansion=2 on by default.

This switches the compiler to -ftrack-macro-expansion=2 by default.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

libcpp/

* init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
by default.  Add comments.

gcc/docs/

* cppopts.texi: Adjust for enabling -ftrack-macro-expansion=2 by
default.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186977 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoAdjust relevant test cases wrt -ftrack-macro-expansion=[0|2]
dodji [Mon, 30 Apr 2012 11:43:29 +0000 (11:43 +0000)]
Adjust relevant test cases wrt -ftrack-macro-expansion=[0|2]

Even after all the patches I have already submitted, some test cases
where errors happens on tokens that are defined in macros see their
output change in an incompatible way, when you run them with or
without -ftrack-macro-expansion.

I think this is expected, because the (spelling) locus inside the
definition of the macro pointed to with -ftrack-macro-expansion is
different from the locus of the expansion point of the macro pointed
to without -ftrack-macro-expansion.

In those cases this patch either adjusts the test case and forces it
be run either with -ftrack-macro-expansion, or it just forces it to be
run without -ftrack-macro-expansion.

There are so many libstdc++ tests that were failing because of that
benign issue that I preferred to just run them with
-ftrack-macro-expansion diabled, after inspecting each of them to be
sure there was nothing more serious underneath.

Boostrapped on x86_64-unknown-linux-gnu against trunk with and without
-ftrack-macro-expansion turned on.

gcc/testsuite/

* objc.dg/foreach-7.m: Force the test case to run without
-ftrack-macro-expansion.
* c-c++-common/tm/attrib-1.c: Likewise.
* c-c++-common/warn-ommitted-condop.c: Likewise.
* gcc.dg/assign-warn-1.c: Likewise.
* gcc.dg/assign-warn-2.c: Likewise.
* gcc.dg/attr-alloc_size.c: Likewise.
* gcc.dg/builtin-stringop-chk-1.c: Likewise.
* gcc.dg/builtin-stringop-chk-2.c: Likewise.
* gcc.dg/builtin-strncat-chk-1.c: Likewise.
* gcc.dg/c90-const-expr-9.c: Likewise.
* gcc.dg/c99-const-expr-9.c: Likewise.
* gcc.dg/cpp/direct2.c: Likewise.  Adjust.
* gcc.dg/cpp/direct2s.c: Likewise.
* gcc/testsuite/gcc.dg/cpp/pr28709.c: Likewise.
* gcc.dg/cpp/pragma-diagnostic-1.c: Likewise.
* gcc.dg/dfp/composite-type.c: Likewise.
* gcc.dg/uninit-6-O0.c: Adjust the test case and force it to run
with -ftrack-macro-expansion
* g++.dg/cpp0x/constexpr-ex3.C: Likewise.
* g++.dg/cpp0x/constexpr-overflow.C: Likewise.
* g++.dg/ext/cleanup-1.C: Likewise.
* g++.dg/ext/gnu-inline-global-reject.C: Likewise.
* g++.dg/template/sfinae10.C: Likewise.
* g++.dg/tm/wrap-2.C: Likewise.
* g++.dg/warn/Wconversion-real-integer.C: Likewise.
* g++.dg/warn/Wsign-conversion.C: Likewise.
* g++.dg/warn/multiple-overflow-warn-1.C: Likewise.
* g++.old-deja/g++.mike/p10769b.C: Likewise.
* g++.dg/warn/Wdouble-promotion.C: Adjust the test case and force
it to run with -ftrack-macro-expansion.
* libstdc++-v3/scripts/testsuite_flags.in: By default, run the
test cases without -ftrack-macro-expansion.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186976 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix va_start related location
dodji [Mon, 30 Apr 2012 11:43:14 +0000 (11:43 +0000)]
Fix va_start related location

In gcc/testsuite/gcc.dg/pr30457.c, the first warning was not being
emitted because the relevant location was inside the var_start macro
defined in a system header.  It can even point to a token for a
builtin macro there.  This patch unwinds to the first token in real
source code in that case.

Tested on x86_64-unknown-linux-gnu against trunk.

* builtins.c (fold_builtin_next_arg): Unwinds to the first
location in real source code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186975 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix location for static class members
dodji [Mon, 30 Apr 2012 11:43:02 +0000 (11:43 +0000)]
Fix location for static class members

Consider the test case g++.dg/other/offsetof5.C:

    #include <stddef.h>

    struct A
    {
      char c;
      int &i;
    };

    int j = offsetof (A, i); // { dg-warning "invalid access|offsetof" }

    template <typename T>
    struct S
    {
      T h;
      T &i;
      static const int j = offsetof (S, i); // { dg-warning "invalid access|offsetof" }
    };

    int k = S<int>::j; // { dg-message "required from here" }

The second warning (that involves the instantiation of the S template)
is not emitted when -ftrack-macro-expansion is on.

This is because during the instantiation of the member j of S
template, the location that is used for the warning is the one for the
DECL j (set by instantiate_decl).  And that location is inaccurately
set to the locus of 'offsetof', which is a macro defined in a system
header, so it's discarded by the diagnostics machinery.

Note that when we reach the point where we emit the warning in
build_class_member_access_expr offsetof expression has long been
folded, so we cannot use e.g, the location of the ')' token that would
have been in the source code.  So I believe the location of 'j' is the
best we can get at this point.

The patch below sets the location of the DECL for 'j' to what I
believe is its precise location; with that, the test case passes with
and without -ftrack-macro-expansion.  But I had to adjust
g++.dg/template/sfinae6_neg.C for that.

Tested on x86_64-unknown-linux-gnu against trunk.

gcc/cp

* decl.c (grokdeclarator): Use the location carried by the
declarator for the DECL of the static class member.

gcc/testsuite/

* g++.dg/template/sfinae6_neg.C: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186974 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix va_arg type location
dodji [Mon, 30 Apr 2012 11:42:50 +0000 (11:42 +0000)]
Fix va_arg type location

Now that diagnostics first point to the spelling location of tokens
coming from macro expansion, the test case
gcc/testsuite/g++.old-deja/g++.other/vaarg3.C shows that when I write
va_args (args, some_type), the location that is recorded for
"some_type" is not correct.  We wrongly record a location that is in
the system header where the va_args macro is defined.

This patch changes that to correctly record the location for the type
operand of the va_arg expression.

With this patch applied, the
gcc/testsuite/g++.old-deja/g++.other/vaarg3.C test PASSes with and
without -ftrack-macro-expansion.

Tested on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

gcc/cp/

* cp-tree.h (build_x_va_arg): Take an additional location
parameter.
* call.c (build_x_va_arg): Take a loc parameter for the location
of the type of the va_arg expression.
* parser.c (cp_parser_primary_expression): Pass the type of the
type in the va_arg expression to build_x_va_arg.
* pt.c (tsubst_copy): Adjust calls to build_x_va_arg.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186973 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoMake conversion warnings work on NULL with -ftrack-macro-expansion
dodji [Mon, 30 Apr 2012 11:42:38 +0000 (11:42 +0000)]
Make conversion warnings work on NULL with -ftrack-macro-expansion

There are various conversion related warnings that trigger on
potentially dangerous uses of NULL (or __null).  NULL is defined as a
macro in a system header, so calling warning or warning_at on a
virtual location of NULL yields no diagnostic.  So the test
accompanying this patch (as well as others), was failling when run
with -ftrack-macro-expansion.

I think it's necessary to use the location of NULL that is in the main
source code (instead of, e.g, the spelling location that is in the
system header where the macro is defined) in those cases.  Note that
for __null, we don't have the issue.

I have augmented the test of this patch to check that we don't regress
when handling __null.

Tested on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

gcc/
* input.h (expansion_point_location_if_in_system_header): Declare
new function.
* input.c (expansion_point_location_if_in_system_header): Define it.
gcc/cp/

* call.c (conversion_null_warnings): Use the new
expansion_point_location_if_in_system_header.
* cvt.c (build_expr_type_conversion): Likewise.
* typeck.c (cp_build_binary_op): Likewise.

gcc/testsuite/

* g++.dg/warn/Wconversion-null-2.C: Add testing for __null,
alongside the previous testing for NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186972 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix -Wuninitialized for -ftrack-macro-expansion
dodji [Mon, 30 Apr 2012 11:42:25 +0000 (11:42 +0000)]
Fix -Wuninitialized for -ftrack-macro-expansion

Besides the warning emitted by warn_uninit, this function wants
to hint the user at where the uninitialized variable was declared, for
cases where the declaration location is outside the current function.

Now that expand_location expands to the location that is in the main
source file (even for -ftrack-macro-expansion) the hinting part was
not working well for cases where the variable is declared in a macro
(outside the function), which is then expanded in the function.

So I had to adjust warn_uninit a little bit to make it consider the
spelling location of the variable declaration.

I have fixed the test gcc.dg/cpp/pragma-diagnostic-2.c on which I
believe gcc shouldn't emit any error.

Here is the new output on that test:

=~=
gcc.dg/cpp/pragma-diagnostic-2.c: In function 'g':
gcc.dg/cpp/pragma-diagnostic-2.c:10:5: warning: 'a' is used uninitialized in this function [-Wuninitialized]
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: 'a' was declared here
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: in expansion of macro 'CODE_WITH_WARNING'
gcc.dg/cpp/pragma-diagnostic-2.c:17:3: note: expanded from here
gcc.dg/cpp/pragma-diagnostic-2.c: In function 'h':
gcc.dg/cpp/pragma-diagnostic-2.c:10:5: warning: 'a' is used uninitialized in this function [-Wuninitialized]
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: 'a' was declared here
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: in expansion of macro 'CODE_WITH_WARNING'
gcc.dg/cpp/pragma-diagnostic-2.c:27:3: note: expanded from here
=~=

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion turned on
exhibits other separate issues that are addressed in subsequent
patches.  This patch just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

gcc/
* tree-ssa.c (warn_uninit): Use the spelling location of the
variable declaration.  Use linemap_location_before_p for source
locations.

gcc/testsuite/

* gcc.dg/cpp/pragma-diagnostic-2.c:  Fix this.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186971 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoStrip "<built-in>" loc from displayed expansion context
dodji [Mon, 30 Apr 2012 11:42:12 +0000 (11:42 +0000)]
Strip "<built-in>" loc from displayed expansion context

Now that diagnostics for tokens coming from macro expansions point to
the spelling location of the relevant token (and then displays the
context of the expansion), some ugly (not so seldom) corner cases can
happen.

When the relevant token is a built-in token (which means the location
of that token is BUILTINS_LOCATION) the location prefix displayed to
the user in the diagnostic line is the "<built-in>:0:0" string.  For
instance:

    <built-in>:0:0: warning: conversion to 'float' alters 'int' constant value

For the user, I think this is surprising and useless.

A more user-friendly approach would be to refer to the first location
that (in the reported macro expansion context) is for a location in
real source code, like what is shown in the new test case
gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C accompanying
this patch.

To do this, I am making the line-map module provide a new
linemap_unwind_to_first_non_reserved_loc function that resolves a
virtual location to the first spelling location that is in real source
code.

I am then using that facility in the diagnostics printing module and
in the macro unwinder to avoid printing diagnostics lines that refer
to the locations for built-ins or more generally for reserved
locations.  Note that when I start the dance of skipping a built-in
location I also skip locations that are in system headers, because it
turned out that a lot of those built-ins are actually used in system
headers (e.g, "#define INT_MAX __INT_MAX__" where __INT_MAX__ is a
built-in).

Besides the user-friendliness gain, this patch allows a number of
regression tests to PASS unchanged with and without
-ftrack-macro-expansion.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

libcpp/

* include/line-map.h (linemap_unwind_toward_expansion): Fix typo
in comment.
(linemap_unwind_to_first_non_reserved_loc): Declare new function.
* line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
new function.

gcc/

* input.c (expand_location_1): When expanding to spelling location
in a context of a macro expansion, skip reserved system header
locations.  Update comments.  * tree-diagnostic.c
(maybe_unwind_expanded_macro_loc): Likewise.

gcc/testsuite/

* g++.dg/warn/Wconversion-real-integer2.C: New test.
* g++.dg/warn/Wconversion-real-integer-3.C: Likewise.
* g++.dg/warn/conversion-real-integer-3.h: New header used by the
new test above.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186970 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoMake expand_location resolve to locus in main source file
dodji [Mon, 30 Apr 2012 11:42:00 +0000 (11:42 +0000)]
Make expand_location resolve to locus in main source file

Apparently, quite some places in the compiler (like the C/C++
preprocessor, the debug info machinery) expect expand_location to
resolve to locations that are in the main source file, even if the
token at stake comes from a macro that was defined in a header
somewhere.  Turning on -ftrack-macro-expansion by default was
triggering a lot of failures (not necessarily related to diagnostics)
because expand_location resolves to spelling locations instead.

So I have changed expand_location to honour the initial expectation.

In addition, I came up with the new expand_location_to_spelling_point
used in diagnostic_build_prefix because the diagnostic system, on the
other hand, wants to point to the location of the token where it was
spelled, and then display the error context involving all the macro
whose expansion led to that spelling point - if we are in the context
of a macro expansion there.

This seems to me like a reasonable balance.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk and
whitnessed that a lot more tests were PASSing.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

gcc/

* input.c (expand_location_1): New.  Takes a parameter to choose
whether to resolve the location to spelling or expansion point.
Was factorized from ...
(expand_location): ... here.
(expand_location_to_spelling_point): New.  Implemented in terms of
expand_location_1.
* diagnostic.c (diagnostic_build_prefix): Use the new
expand_location_to_spelling_point instead of expand_location.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186969 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix expansion point loc for macro-like tokens
dodji [Mon, 30 Apr 2012 11:41:46 +0000 (11:41 +0000)]
Fix expansion point loc for macro-like tokens

Consider the test case gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c.
Its interesting part is:

    #define A(x) vari x /* line 7.  */
    #define vari(x)
    #define B , varj
    int A(B) ;  /* line 10.  */

In its initial version, this test was being pre-processed as:

    # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
    # 1 "build/gcc//"
    # 1 "<command-line>"
    # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
    # 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
    int
    # 7 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
 vari

, varj ;

Note how "int" and "vari" are on separate lines, whereas "int" and
", varj" are on the same line.

This looks like a bug to me, even independantly from the macro
location tracking work.

With macro location tracking turned on, the preprocessed output
becomes:

    # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
    # 1 "<command-line>"
    # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
    # 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
    int vari , varj ;

Which, IMO, is what we'd expect.

This is due to an unexpected side effect of enter_macro_context when
passed a token that might look like a function-like macro at first
sight, but that it eventually considers to not be a macro after all.

This is the case for the "vari" token which looks like a macro when it
is first lexed, but is eventually considered to be a normal token by
enter_macro_context because it's not used as a function-like macro
invocation.

In that case, besides returning NULL, enter_macro_context sets
pfile->context->c.macro to NULL, making cpp_get_token_1 forget to set
the location of the "vari" to the expansion point of A.

enter_macro_context sets pfile->context->c.macro to NULL in that case
because funlike_invocation_p reads one token pass "foo", sees that
there is no '(' token, so we are not invoking the function-like
parameter.  It then puts the tokens (which it has read after "foo")
back into the tokens stream by calling _cpp_push_token_context on it,
which sets pfile->context->c.macro to NULL, saying in essence that the
current macro expansion context is "stopped".

The fix here is to teach _cpp_push_token and
push_extended_tokens_context to continue the current macro context
when passed a NULL macro.  But then, now that there can be several
continguous contexts associated with the same macro, we need to teach
_cpp_pop_context to re-enable the expansion of the current macro only
when we are really out of expanding the current macro.  Otherwise we
can run in cases where we have recursive expansions of the same macro.

Tested on x86_64-unknown-linux-gnu against trunk.  Now this test has
the same output with and without tracking locations accross macro
expansions.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

libcpp/
* macro.c (macro_of_context): New static function.
(_cpp_push_token_context, push_extended_tokens_context): If the
macro argument is NULL, it means we are continuing the expansion
of the current macro, if any.  Update comments.
(_cpp_pop_context): Re-enable expansion of the macro only when we
are really out of the context of the current expansion.

gcc/testsuite/

* gcc.dg/debug/dwarf2/pr41445-5.c: Adjust.
* gcc.dg/debug/dwarf2/pr41445-6.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186968 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix PCH crash on GTYed pointer-to-scalar field of a struct
dodji [Mon, 30 Apr 2012 11:41:34 +0000 (11:41 +0000)]
Fix PCH crash on GTYed pointer-to-scalar field of a struct

When -ftrack-macro-expansion is activated, the PCH generation
machinery can crash in gt_pch_save when it's about to relocate the
pointer for the
line_maps::info_macro::maps[i]::d.macro.macro_locations member.

The call that crashes (in ggc-common.c) is:

    state.ptrs[i]->note_ptr_fn (state.ptrs[i]->obj,
state.ptrs[i]->note_ptr_cookie,
relocate_ptrs, &state);

The ->note_ptr_fn called in this case is the gengtype-generated
gt_pch_p_9line_maps function.  It crashes because the second argument
passed to it is a pointer to struct line_map, instead of being a
pointer to struct line_maps (extra 's') like what the function
expects.

You can see the crash for the test case:

    runtest --tool g++ --tool_opts="-ftrack-macro-expansion" pch.exp=system-1.C

I believe it's because a part of the code of gt_pch_nx_line_maps
(generated as part of gtype-desc.c by gengtype) is not correct.  Note
that this gt_pch_nx_line_maps function is called from gt_pch_save in
the snippet:

  for (rt = gt_ggc_rtab; *rt; rt++)
    for (rti = *rt; rti->base != NULL; rti++)
      for (i = 0; i < rti->nelt; i++)
(*rti->pchw)(*(void **)((char *)rti->base + rti->stride * i));

So, in that gt_pch_nx_line_maps, in the branch that starts with the
code:

      if ((*x).info_macro.maps != NULL) {
        size_t i3;
        for (i3 = 0; i3 != (size_t)(((*x).info_macro).used); i3++) {
          switch (((*x).info_macro.maps[i3]).reason == LC_ENTER_MACRO)

we have the code:

    gt_pch_note_object ((*x).info_macro.maps[i3].d.macro.macro_locations,
(*x).info_macro.maps,
 gt_pch_p_9line_maps,
  gt_types_enum_last);

This last snippet registers gt_pch_p_9line_maps to be called on the
object pointed by (*x).info_macro.maps[i3].d.macro.macro_locations (as
a first argument), with (*x).info_macro.maps as its second argument.

Note that (*x).info_macro.maps is of type struct line_map*, while 'x'
is of type struct line_maps* - beware, there is an 's' at the end of
the latter.

The problem is that gt_pch_p_9line_maps requires that its second
argument be an instance of _struct line_maps_, not struct line_map.
So later when gt_pch_p_9line_maps is called, it just crashes.

More generally, these gt_pch_p_xxx functions seem to require that
their second argument be an instance of the xxx in question.  And that
invariant is violated by the snippet of code above.

The invariant seems to be violated only for the case where a GTYed
structure (possibly embedded in another GTYed structure) contains a
pointer to a scalar (that is not a string) which memory is ggc/GTY
managed, like the line_map_macro::macro_locations field.  And this
only happens for PCH generation.

Looking at gengtype.c, it seems like write_types_process_field can be
fooled in that case.  It expects that the expression d->prev_val[3]
contains the name of the second argument of the gt_pch_p_xxx (which is
generically referenced by wtd->subfield_marker_routine there).  That
expression can resolve to either "x", as we would like it to be, but
can also resolve to another arbitrary name for e.g, the case of a
pointer-to-struct used as a root).

This patch simply forces the second argument of gt_pch_p_xxx to be 'x'
even in the case of a member that is a pointer to a scalar.

As a result, here is the the diff the new generated gtype-desc.c file:

@@ -5234,7 +5234,7 @@ gt_pch_nx_line_maps (void *x_p)
                 size_t i2;
                 for (i2 = 0; i2 != (size_t)(2 * ((*x).info_ordinary.maps[i0].d.macro).n_tokens); i2++) {
                 }
-                gt_pch_note_object ((*x).info_ordinary.maps[i0].d.macro.macro_locations, (*x).info_ordinary.maps, gt_pch_p_9line_maps, gt_types_enum_last);
+                gt_pch_note_object ((*x).info_ordinary.maps[i0].d.macro.macro_locations, x, gt_pch_p_9line_maps, gt_types_enum_last);
               }
               break;
             default:
@@ -5261,7 +5261,7 @@ gt_pch_nx_line_maps (void *x_p)
                 size_t i5;
                 for (i5 = 0; i5 != (size_t)(2 * ((*x).info_macro.maps[i3].d.macro).n_tokens); i5++) {
                 }
-                gt_pch_note_object ((*x).info_macro.maps[i3].d.macro.macro_locations, (*x).info_macro.maps, gt_pch_p_9line_maps, gt_types_enum_last);
+                gt_pch_note_object ((*x).info_macro.maps[i3].d.macro.macro_locations, x, gt_pch_p_9line_maps, gt_types_enum_last);
               }
               break;
             default:
@@ -9366,7 +9366,7 @@ gt_pch_na_regno_reg_rtx (ATTRIBUTE_UNUSED void *x_p)
     for (i1 = 0; i1 != (size_t)(crtl->emit.x_reg_rtx_no); i1++) {
       gt_pch_n_7rtx_def (regno_reg_rtx[i1]);
     }
-    gt_pch_note_object (regno_reg_rtx, &regno_reg_rtx, gt_pch_pa_regno_reg_rtx, gt_types_enum_last);
+    gt_pch_note_object (regno_reg_rtx, x, gt_pch_pa_regno_reg_rtx, gt_types_enum_last);
   }
 }

I think it's pretty much what I was willing to have.

Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion exhibits
other separate issues that are addressed in subsequent patches.
This patch just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned
off, though.

gcc/

* gengtype.c (write_types_process_field):  Force second argument
of the call to the PCH object hierarchy walker to be 'x'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186967 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix token pasting with -ftrack-macro-expansion
dodji [Mon, 30 Apr 2012 11:41:21 +0000 (11:41 +0000)]
Fix token pasting with -ftrack-macro-expansion

This patch makes token pasting work with -ftrack-macro-expansion
turned on.  It improves some pasting related tests of the gcc.dg/cpp
subdirectory.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

libcpp/

* macro.c (paste_all_tokens): Put the token resulting from pasting
into an extended token context with -ftrack-macro-location is in
effect.

gcc/testsuite/

* gcc.dg/cpp/paste17.c: New test case for
-ftrack-macro-expansion=2 mode only.
* gcc.dg/cpp/macro-exp-tracking-5.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186966 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoFix cpp_sys_macro_p with -ftrack-macro-expansion
dodji [Mon, 30 Apr 2012 11:41:08 +0000 (11:41 +0000)]
Fix cpp_sys_macro_p with -ftrack-macro-expansion

cpp_sys_macro_p crashes when -ftrack-macro-expansion is on.  The issue
can be reproduced by running the tests:

    runtest --tool gcc --tool_opts="-ftrack-macro-expansion" cpp.exp=sysmac1.c
    runtest --tool gcc --tool_opts="-ftrack-macro-expansion" cpp.exp=sysmac2.c

This is because it just doesn't support that mode.  Fixed thus.
Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion turned on
exhibits other separate issues that are addressed in subsequent
patches.  This patch just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

libcpp/

* macro.c (cpp_sys_macro_p):  Support -ftrack-macro-expansion.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186965 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * gcc-interface/decl.c (gnat_to_gnu_entity): In type annotation mode,
ebotcazou [Mon, 30 Apr 2012 08:31:29 +0000 (08:31 +0000)]
* gcc-interface/decl.c (gnat_to_gnu_entity): In type annotation mode,
do not adjust the size of a tagged type if there is a representation
clause on it.  Otherwise, round the adjustment up to the alignment
of the first field and use the appropriate helper routine.
(maybe_pad_type): Do not warn in type annotation mode on a tagged type.
(gnat_to_gnu_field): Do not error out under the same circumstances.
(annotate_rep): In type annotation mode, do not adjust the offset of
components of a tagged type with representation clause.  Otherwise,
round the adjustment up to the alignment of the first field.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186961 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * config/i386/i386.c (ix86_handle_struct_attribute): Use the proper
ebotcazou [Mon, 30 Apr 2012 08:11:42 +0000 (08:11 +0000)]
* config/i386/i386.c (ix86_handle_struct_attribute): Use the proper
predicate to discriminate types.
ada/
* gcc-interface/utils.c (finish_record_type): Force the traditional GCC
layout for bitfields on the type if it is packed or has a representation
clause and an alternate layout is available.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186958 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
manu [Mon, 30 Apr 2012 08:02:53 +0000 (08:02 +0000)]
2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>

        * c-common.c (check_function_arguments): Replace
        Wmissing-format-attribute with Wsuggest-attribute=format.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186957 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * gcc-interface/gigi.h (mark_out_of_scope): Delete.
ebotcazou [Mon, 30 Apr 2012 07:50:07 +0000 (07:50 +0000)]
* gcc-interface/gigi.h (mark_out_of_scope): Delete.
(destroy_gnat_to_gnu): Declare.
(destroy_dummy_type): Likewise.
* gcc-interface/decl.c (mark_out_of_scope): Delete.
* gcc-interface/utils.c (destroy_gnat_to_gnu): New function.
(destroy_dummy_type): Likewise.
* gcc-interface/trans.c (gnat_validate_uc_list): New variable.
(gigi): Call validate_unchecked_conversion on gnat_validate_uc_list
after the translation is completed.  Call destroy_gnat_to_gnu and
destroy_dummy_type at the end.
(Subprogram_Body_to_gnu): Do not call mark_out_of_scope.
(gnat_to_gnu) <N_Block_Statement>: Likewise.
<N_Validate_Unchecked_Conversion>: Do not process the node, only push
it onto gnat_validate_uc_list.
(validate_unchecked_conversion): New function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186956 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
manu [Mon, 30 Apr 2012 07:42:42 +0000 (07:42 +0000)]
2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>

gcc/
* doc/invoke.texi (Wmissing-format-attribute): Document as an
alias of Wsuggest-attribute=format.
c-family/
* c.opt (Wsuggest-attribute=format): New. Alias of
Wmissing-format-attribute.
* c-format.c (decode_format_type): Replace
Wmissing-format-attribute with Wsuggest-attribute=format.
(check_function_format): Likewise.
cp/
* typeck.c (convert_for_assignment):  Replace
Wmissing-format-attribute with Wsuggest-attribute=format.
* call.c (convert_for_arg_passing): Likewise.
gcc/
* c-typeck.c (convert_for_assignment): Replace
Wmissing-format-attribute with Wsuggest-attribute=format.
(digest_init): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186955 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoDaily bump.
gccadmin [Mon, 30 Apr 2012 00:18:41 +0000 (00:18 +0000)]
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186952 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-29 Marc Glisse <marc.glisse@inria.fr>
paolo [Sun, 29 Apr 2012 23:36:09 +0000 (23:36 +0000)]
2012-04-29  Marc Glisse  <marc.glisse@inria.fr>
    Paolo Carlini  <paolo.carlini@oracle.com>

PR libstdc++/51795
* include/bits/stl_algobase.h (__lg<>(_Size)): Remove.
(__lg(int), __lg(unsigned), __lg(long), __lg(unsigned long),
__lg(long long), __lg(unsigned long long)): Define constexpr.
* include/bits/random.h (_Mod<>): Overcome Schrage's algorithm
limitations.
(__mod): Adjust.
(linear_congruential): Remove FIXME static_assert.
* include/bits/random.tcc (_Mod<>): Adjust.
* testsuite/26_numerics/random/linear_congruential_engine/operators/
51795.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186948 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago * include/std/functional (function::function(F)): LWG 2132: Disable
redi [Sun, 29 Apr 2012 22:59:37 +0000 (22:59 +0000)]
* include/std/functional (function::function(F)): LWG 2132: Disable
constructor if argument isn't callable.
* testsuite/20_util/function/cons/callable.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186947 138bc75d-0d04-0410-961f-82ee72b054a4

12 years agoDon't use C++ style comments in libcpp
dodji [Sun, 29 Apr 2012 16:27:08 +0000 (16:27 +0000)]
Don't use C++ style comments in libcpp

I noticed that the file lex.c had C++ style comments, which I believe
is against the coding standards of the project.

Fixed, tested and applied to master as per the obvious rule.

libcpp/

* lex.c (lex_raw_string): Change C++ style comments into C
style comments.
(lex_string): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186946 138bc75d-0d04-0410-961f-82ee72b054a4

12 years ago2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
manu [Sun, 29 Apr 2012 09:47:43 +0000 (09:47 +0000)]
2012-04-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR 53149
        * gcc.dg/20011021-1.c: Adjust testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186945 138bc75d-0d04-0410-961f-82ee72b054a4