Commit Graph

112493 Commits

Author SHA1 Message Date
Eric Botcazou
d5899fb5d3 Remove bogus line
From-SVN: r180123
2011-10-18 07:24:51 +00:00
Eric Botcazou
b75eeb3754 * config/sparc/sparc.md (in_call_delay): Fix formatting issues.
From-SVN: r180122
2011-10-18 07:20:38 +00:00
Benjamin Kosnik
4daba88481 [multiple changes]
2011-10-17  Michael Spertus  <mike_spertus@symantec.com>

	* gcc/c-family/c-common.c (c_common_reswords): Add __bases,
	__direct_bases.
	* gcc/c-family/c-common.h: Add RID_BASES and RID_DIRECT_BASES.

2011-10-17  Michael Spertus  <mike_spertus@symantec.com>

	* cp-tree.def: Add BASES as a new tree code.
	* cp-tree.h (enum cp_trait_kind): Add CPTK_BASES, CPTK_DIRECT_BASES.
	(BASES_TYPE, BASES_DIRECT): Define.
	(calculate_bases, finish_bases, calculate_direct_bases): Declare.
	* parser.c (cp_parser_trait_expr, cp_parser_template_argument_list,
	(cp_parser_simple_type_specifier, cp_parser_save_nsdmi): Use them.
	* pt.c (find_parameter_packs_r, tsubst_pack_expansion): Likewise.
	* semantics.c (calculate_bases, finish_bases, calculate_direct_bases,
	dfs_calculate_bases_pre, dfs_calculate_bases_post,
	calculate_bases_helper): Define.

2011-10-17  Michael Spertus  <mike_spertus@symantec.com>

	* g++.dg/ext/bases.C: New test.

2011-10-17  Michael Spertus  <mike_spertus@symantec.com>

	* include/tr2/type_traits (bases, direct_bases, typelist): New.

2011-10-17  Benjamin Kosnik  <bkoz@redhat.com>

	* libstdc++-v3/include/Makefile.am: Add tr2 directory and includes.
	* libstdc++-v3/include/Makefile.in: Regenerate.

	* scripts/create_testsuite_files: Search tr2 directory.
	* testsuite/libstdc++-dg/conformance.exp: Same.

	* testsuite/tr2/bases/requirements/explicit_instantiation.cc: New.
	* testsuite/tr2/bases/requirements/typedefs.cc: New.
	* testsuite/tr2/bases/value.cc: New.
	* testsuite/tr2/direct_bases/requirements/
	explicit_instantiation.cc: New.
	* testsuite/tr2/direct_bases/requirements/typedefs.cc: New.
	* testsuite/tr2/direct_bases/value.cc: New.

From-SVN: r180121
2011-10-18 02:58:06 +00:00
Richard Henderson
9d4dedaa7b Add sparc vec_perm patterns when VIS2.
* config/sparc/sparc.md (vec_perm_constv8qi, vec_perm<mode>): New
	patterns.
	* config/sparc/sparc.c (sparc_expand_vec_perm_bmask): New function.
	* config/sparc/sparc-protos.h (sparc_expand_vec_perm_bmask): Declare.

From-SVN: r180119
2011-10-17 17:25:30 -07:00
GCC Administrator
d62fc6ed20 Daily bump.
From-SVN: r180118
2011-10-18 00:18:39 +00:00
Simon Baldwin
08b2bad275 configure.ac: Add --with-native-system-header-dir.
* configure.ac: Add --with-native-system-header-dir.  Set and
	substitute NATIVE_SYSTEM_HEADER_DIR.  Use native_system_header
	when setting target_header_dir.
	* config.gcc: Always set native_system_header_dir.
	(*-*-gnu*): Set native_system_header_dir.  Don't use t-gnu.
	(i[34567]86-pc-msdosdjgpp*): Set native_system_header_dir.  Don't
	use i386/t-djgpp.
	(i[34567]86-*-mingw* | x86_64-*-mingw*): Set
	native_system_header_dir.
	(spu-*-elf*): Set native_system_header_dir.
	* Makefile.in (NATIVE_SYSTEM_HEADER_DIR): Set to
	@NATIVE_SYSTEM_HEADER_DIR@.
	(PREPROCESSOR_DEFINES): Define NATIVE_SYSTEM_HEADER_DIR.
	* cppdefault.c (STANDARD_INCLUDE_DIR): Don't define.
	(NATIVE_SYSTEM_HEADER_COMPONENT): Rename from
	STANDARD_INCLUDE_COMPONENT.
	(cpp_include_defaults): Don't use SYSTEM_INCLUDE_DIR.  Rename
	STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR.
	* system.h: Poison SYSTEM_INCLUDE_DIR, STANDARD_INCLUDE_DIR, and
	STANDARD_INCLUDE_COMPONENT.
	* config/i386/t-mingw32 (NATIVE_SYSTEM_HEADER_DIR): Remove.
	* config/i386/t-mingw-w32: Likewise.
	* config/i386/t-mingw-w64: Likewise.
	* config/spu/t-spu-elf: Likewise.
	* config/i386/t-djgpp: Remove.
	* config/t-gnu: Remove.
	* config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Don't define.
	(NATIVE_SYSTEM_HEADER_COMPONENT): Rename from
	STANDARD_INCLUDE_COMPONENT.
	* config/i386/djgpp.h (STANDARD_INCLUDE_DIR): Don't define.
	* config/spu/spu-elf.h: Likewise.
	* config/vms/xm-vms.h: Likewise.
	* config/gnu.h: Likewise.
	* config/openbsd.h (INCLUDE_DEFAULTS): Change STANDARD_INCLUDE_DIR
	and STANDARD_INCLUDE_COMPONENT to NATIVE_SYSTEM_HEADER_DIR and
	NATIVE_SYSTME_HEADER_COMPONENT.
	* doc/install.texi (Configuration): Document
	--with-native-system-header-dir.  Mention it in the documentation
	for --with-sysroot and --with-build-sysroot.
	* doc/tm.texi.in (Driver): Don't document SYSTEM_INCLUDE_DIR or
	STANDARD_INCLUDE_DIR.  Rename STANDARD_INCLUDE_COMPONENT to
	NATIVE_SYSTEM_HEADER_COMPONENT.  Rename uses of
	STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR.
	* doc/fragments.texi (Target Fragment): Don't document
	NATIVE_SYSTEM_HEADER_DIR.
	* configure, doc/tm.texi: Rebuild.

Co-Authored-By: Ian Lance Taylor <iant@google.com>

From-SVN: r180114
2011-10-17 23:31:25 +00:00
Richard Henderson
d1947945f5 Fix predicates used in sparc VIS edge instructions.
* config/sparc/sparc.md: Use register_or_zero_operand where rJ
	is the constraint.

From-SVN: r180113
2011-10-17 16:04:48 -07:00
David S. Miller
e00560c290 Segregate sparc's handling of vector vs. non-vector modes.
gcc/
	* config/sparc/sparc-modes.def: Add single entry vector modes for
	DImode and SImode.
	* config/sparc/sparc/sparc.md (V32, V32I, V64, V64I, V64N8): Delete
	mode iterators.
	(mov<V32:mode>): Revert back to plain SFmode pattern.
	(*movsf_insn): Likewise.
	(mov<V64:mode>): Revert back to plain DFmode pattern.
	(*movdf_insn_sp32): Likewise.
	(*movdf_insn_sp32_v9): Likewise.
	(*movdf_insn_sp64): Likewise.
	(V64 mode splitters) Likewise.
	(addsi3): Remove VIS alternatives.
	(subsi3): Likewise.
	(and<V64I:mode>3): Revert to DImode only pattern.
	(and<V64I:mode>3_sp32): Likewise.
	(*and<V64I:mode>3_sp64): Likewise.
	(and<V32I:mode>3): Likewise.
	(*and_not_<V64I:mode>_sp32): Likewise.
	(*and_not_<V64I:mode>_sp64): Likewise.
	(*and_not_<V32I:mode>): Likewise.
	(ior<V64I:mode>3): Likewise.
	(*ior<V64I:mode>3_sp32): Likewise.
	(*ior<V64I:mode>3_sp64): Likewise.
	(ior<V32I:mode>3): Likewise.
	(*or_not_<V64I:mode>_sp32): Likewise.
	(*or_not_<V64I:mode>_sp64): Likewise.
	(*or_not_<V32I:mode>): Likewise.
	(xor<V64I:mode>3): Likewise.
	(*xor<V64I:mode>3_sp32): Likewise.
	(*xor<V64I:mode>3_sp64): Likewise.
	(xor<V32I:mode>3): Likewise.
	(V64I mode splitters): Likewise.
	(*xor_not_<V64I:mode>_sp32): Likewise.
	(*xor_not_<V64I:mode>_sp64): Likewise.
	(*xor_not_<V32I:mode>): Likewise.
	(one_cmpl<V64I:mode>2): Likewise.
	(*one_cmpl<V64I:mode>2_sp32): Likewise.
	(*one_cmpl<V64I:mode>2_sp64): Likewise.
	(one_cmpl<V32I:mode>2): Likewise.
	(VM32, VM64, VMALL): New mode iterators.
	(vbits, vconstr, vfptype): New mode attributes.
	(mov<VMALL:mode>): New expander.
	(*mov<VM32:mode>_insn): New insn.
	(*mov<VM64:mode>_insn_sp64): New insn.
	(*mov<VM64:mode>_insn_sp32): New insn, and associated splitter
	specifically for the register to memory case.
	(vec_init<mode>): New expander.
	(VADDSUB): New mode iterator.
	(<plusminus_insn>v2si3, <plusminus_insn>v2hi3): Remove and replace
	with...
	(<plusminus_insn><mode>3): New consolidated pattern.
	(VL): New mode iterator for logical operations.
	(vlsuf): New more attribute.
	(vlop): New code iterator.
	(vlinsn, vlninsn): New code attributes.
	(<code><mode>3): New insn to non-negated vector logical ops.
	(*not_<code><mode>3): Likewise for negated variants.
	(*nand<mode>_vis): New insn.
	(vlnotop): New code iterator.
	(*<code>_not1<mode>_vis, *<code>_not2<mode>_vis): New insns.
	(one_cmpl<mode>2): New insn.
	(faligndata<V64I:mode>_vis): Rewrite to use VM64 iterator.
	(bshuffle<VM64:mode>_vis): Likewise.
	(v<vis3_shift_patname><mode>3): Use GCM mode iterator.
	(fp<plusminus_insn>64_vis): Use V1DI mode.
	(VASS mode iterator): Use V1SI not SI mode.
	* config/sparc/sparc.c (sparc_vis_init_builtins): Account for
	single-entry vector mode changes.
	(sparc_expand_builtin): Likewise.
	(sparc_expand_vector_init): New function.
	* config/sparc/sparc-protos.h (sparc_expand_vector_init): Declare.

gcc/testsuite/

	* gcc.target/sparc/fand.c: Remove __LP64__ ifdefs and expect
	all operations to emit VIS instructions.
	* gcc.target/sparc/fandnot.c: Likewise.
	* gcc.target/sparc/fnot.c: Likewise.
	* gcc.target/sparc/for.c: Likewise.
	* gcc.target/sparc/fornot.c: Likewise.
	* gcc.target/sparc/fxnor.c: Likewise.
	* gcc.target/sparc/fxor.c: Likewise.
	* gcc.target/sparc/combined-1.c: Revert change to use -O2, no longer
	needed.

From-SVN: r180112
2011-10-17 15:50:29 -07:00
Jakub Jelinek
b2c4e3157f vshuf-v16hi.c: New test.
* gcc.c-torture/execute/vshuf-v16hi.c: New test.
	* gcc.dg/torture/vshuf-16.inc: New file.
	* gcc.dg/torture/vshuf-2.inc: New file.
	* gcc.dg/torture/vshuf-32.inc: New file.
	* gcc.dg/torture/vshuf-4.inc: New file.
	* gcc.dg/torture/vshuf-8.inc: New file.
	* gcc.dg/torture/vshuf-main.inc: New file.
	* gcc.dg/torture/vshuf-v16hi.c: New test.
	* gcc.dg/torture/vshuf-v16qi.c: New test.
	* gcc.dg/torture/vshuf-v2df.c: New test.
	* gcc.dg/torture/vshuf-v2di.c: New test.
	* gcc.dg/torture/vshuf-v2sf.c: New test.
	* gcc.dg/torture/vshuf-v2si.c: New test.
	* gcc.dg/torture/vshuf-v32qi.c: New test.
	* gcc.dg/torture/vshuf-v4df.c: New test.
	* gcc.dg/torture/vshuf-v4di.c: New test.
	* gcc.dg/torture/vshuf-v4hi.c: New test.
	* gcc.dg/torture/vshuf-v4sf.c: New test.
	* gcc.dg/torture/vshuf-v4si.c: New test.
	* gcc.dg/torture/vshuf-v8hi.c: New test.
	* gcc.dg/torture/vshuf-v8qi.c: New test.
	* gcc.dg/torture/vshuf-v8sf.c: New test.
	* gcc.dg/torture/vshuf-v8si.c: New test.

From-SVN: r180110
2011-10-17 22:22:39 +02:00
Kai Tietz
6e796a8374 fold-const.c (simple_operand_p_2): New function.
* fold-const.c (simple_operand_p_2): New function.
	(fold_truthop): Rename to
	(fold_truth_andor_1): function name.
	Additionally remove branching creation for logical and/or.
	(fold_truth_andor): Handle branching creation for logical and/or here.

From-SVN: r180109
2011-10-17 22:18:31 +02:00
Andi Kleen
1eca213e3f ggc-page.c (USING_MADVISE): Adjust ifdef to check for USING_MMAP.
2011-10-17  Andi Kleen  <ak@linux.intel.com>

       * ggc-page.c (USING_MADVISE): Adjust ifdef to check for
       USING_MMAP.

From-SVN: r180107
2011-10-17 19:47:12 +00:00
Ira Rosen
44729eb72b re PR tree-optimization/50746 (FAIL: gcc.dg/vect/pr37482.c (internal compiler error) on powerpc-apple-darwin9)
PR tree-optimization/50746
        * gcc.dg/vect/vect-114.c: Remove vect_hw_misalign.

From-SVN: r180106
2011-10-17 19:03:02 +00:00
Jason Merrill
c6334ca906 re PR c++/50736 ([C++0x] ISO_IEC_14882-2011-5.1.2/10 - bug)
PR c++/50736
	* parser.c (cp_parser_lambda_introducer): Check for more
	invalid captures.

From-SVN: r180105
2011-10-17 14:59:41 -04:00
Georg-Johann Lay
7c3297ce40 avr.h (ASSEMBLER_DIALECT): Remove.
* config/avr/avr.h (ASSEMBLER_DIALECT): Remove.
	* config/avr/avr.md (mcu_have_movw, mcu_mega): Remove attributes.
	(adjust_len): Add alternative "call".
	(isa, enabled): New insn attributes.
	(length): Use match_test with AVR_HAVE_JMP_CALL instead of
	mcu_mega attribute.
	(*sbrx_branch<mode>): Ditto.
	(*sbrx_and_branch<mode>): Ditto.
	(*sbix_branch): Ditto.
	(*sbix_branch_bit7): Ditto.
	(*sbix_branch_tmp): Ditto.
	(*sbix_branch_tmp_bit7): Ditto.
	(jump): Ditto.
	(negsi2): Use attribute "isa" instead of assembler dialect.
	(extendhisi2): Ditto.
	(call_insn, call_value_insn): Set adjust_len attribute.
	(indirect_jump): Indent to coding rules.
	(call_prologue_saves): Use isa attribute instead of mcu_mega.
	(epilogue_restores): Ditto.  Fix setting of SP as described in the
	RTX pattern.
	(*indirect_jump): Fusion of *jcindirect_jump, *njcindirect_jump
	and *indirect_jump_avr6.
	(*tablejump): Fusion of *tablejump_rjmp and *tablejump_lib.
	(*jcindirect_jump, *njcindirect_jump, *indirect_jump_avr6): Remove.
	(*tablejump_rjmp, *tablejump_lib): Remove.
	* config/avr/avr.c (adjust_insn_length): Handle ADJUST_LEN_CALL.

From-SVN: r180104
2011-10-17 17:53:07 +00:00
Paolo Carlini
a7248d5fe3 re PR c++/44524 (improve diagnostic for . vs -> typo)
/cp
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/44524
	* typeck.c (build_class_member_access_expr): Provide a better error
	message for X.Y where X is a pointer to class type.
	(finish_class_member_access_expr): Likewise.

/testsuite
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/44524
	* g++.dg/parse/error41.C: New.
	* g++.dg/parse/error20.C: Adjust.

From-SVN: r180103
2011-10-17 17:51:00 +00:00
Paolo Carlini
3e8f763093 re PR c++/50757 (Cannot turn off -Wnonnull when using C++)
/gcc
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50757
	* c-family/c.opt ([Wnonnull]): Add C++ and Objective-C++.
	* doc/invoke.texi: Update.

/testsuite
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50757
	* g++.dg/warn/format7.C: New.
	* obj-c++.dg/warn7.mm: Likewise.

From-SVN: r180102
2011-10-17 17:49:06 +00:00
Paolo Carlini
ef12edb597 re PR c++/50757 (Cannot turn off -Wnonnull when using C++)
/gcc
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50757
	* c-family/c.opt ([Wnonnull]): Add C++ and Objective-C++.
	* doc/invoke.texi: Update.

/testsuite
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50757
	* g++.dg/warn/format7.C: New.
	* obj-c++.dg/warn7.mm: Likewise.

From-SVN: r180101
2011-10-17 17:44:42 +00:00
Richard Henderson
42a04c4841 re PR tree-optimization/50746 (FAIL: gcc.dg/vect/pr37482.c (internal compiler error) on powerpc-apple-darwin9)
PR 50746
        * optabs.c (expand_vec_perm_expr): Fix indexing error.

From-SVN: r180100
2011-10-17 10:02:05 -07:00
Uros Bizjak
1e06b07d0c re PR target/50737 (FAIL: Throw_3 -O3 execution, generic dwarf2 EH problem?)
libgcc/ChangeLog:

2011-10-16  Uros Bizjak  <ubizjak@gmail.com>
	    Eric Botcazou  <ebotcazou@adacore.com>

	PR target/50737
	* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Set
	fs->signal_frame to 1.

libjava/ChangeLog:

2011-10-16  Uros Bizjak  <ubizjak@gmail.com>
	    Eric Botcazou  <ebotcazou@adacore.com>

	PR target/50737
	* include/dwarf2-signal.h [__alpha__]: Remove MAKE_THROW_FRAME
	definition.


Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>

From-SVN: r180098
2011-10-17 17:36:28 +02:00
Rainer Orth
47fc10353d Remove duplicate symbol in gnu.ver (PR bootstrap/50715)
PR bootstrap/50715
	* config/abi/pre/gnu.ver (CXXABI_1.3.6): Remove duplicate
	__cxa_get_exception_ptr.

From-SVN: r180097
2011-10-17 15:14:54 +00:00
Sergio Durigan Junior
d11aaed74f configure.ac: Display `yes' if the SystemTap header has been found.
2011-10-17  Sergio Durigan Junior  <sergiodj@redhat.com>

	* configure.ac: Display `yes' if the SystemTap header has been
	found.
	* configure: Regenerate.

From-SVN: r180095
2011-10-17 14:47:01 +00:00
Andi Kleen
711a3d82e5 Use MADV_DONTNEED for freeing in garbage collector
Use the Linux MADV_DONTNEED call to unmap free pages in the garbage
collector.Then keep the unmapped pages in the free list. This avoid
excessive memory fragmentation on large LTO bulds, which can lead
to gcc bumping into the Linux vm_max_map limit per process.

gcc/:

2011-10-08  Andi Kleen  <ak@linux.intel.com>

	PR other/50636
	* config.in, configure: Regenerate.
	* configure.ac (madvise): Add to AC_CHECK_FUNCS.
	* ggc-page.c (USING_MADVISE): Add.
	(page_entry): Add discarded field.
	(alloc_page): Check for discarded pages.
	(release_pages): Add USING_MADVISE branch.

From-SVN: r180093
2011-10-17 14:43:37 +00:00
Dodji Seketeli
411f92de7a Fix bootstrapping with --disable-checking
libcpp/ChangeLog

	* line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
	variable without using it if ENABLE_CHECKING is not defined.  Mark
	the LOCATION parameter as being unused.

From-SVN: r180090
2011-10-17 16:01:37 +02:00
Richard Guenther
7d5a0f1b4e re PR tree-optimization/50729 (Silent code gen fault: Value range propagation seems to propagate values across narrowing/widening)
2011-10-17  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/50729
	* tree-vrp.c (extract_range_from_unary_expr_1): Remove
	redundant test.
	(simplify_conversion_using_ranges): Properly test the
	intermediate result.

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

From-SVN: r180087
2011-10-17 12:22:54 +00:00
Tom Tromey
b9bd6f7438 Reduce memory waste due to non-power-of-2 allocs
This patch basically arranges for the allocation size of line_map
buffers to be as close as possible to a power of two.  This
*significantly* decreases peak memory consumption as (macro) maps are
numerous and stay live during all the compilation.

The patch adds a new ggc_round_alloc_size interface to the ggc
allocator.  In each of the two main allocator implementations ('page'
and 'zone') the function has been extracted from the main allocation
function code and returns the actual size of the allocated memory
region, thus giving a chance to the caller to maximize the amount of
memory it actually uses from the allocated memory region.  In the
'none' allocator implementation (that uses xmalloc) the
ggc_round_alloc_size just returns the requested allocation size.

Co-Authored-By: Dodji Seketeli <dodji@redhat.com>

From-SVN: r180086
2011-10-17 12:00:07 +02:00
Tom Tromey
64a1a422db Add line map statistics to -fmem-report output
This patch adds statistics about line maps' memory consumption and
macro expansion to the output of -fmem-report.  It has been useful in
trying to reduce the memory consumption of the macro maps support.

Co-Authored-By: Dodji Seketeli <dodji@redhat.com>

From-SVN: r180085
2011-10-17 11:59:52 +02:00
Tom Tromey
847e697a24 Support -fdebug-cpp option
This patch adds -fdebug-cpp option. When used with -E this dumps the
relevant macro map before every single token. This clutters the output
a lot but has proved to be invaluable in tracking some bugs during the
development of the virtual location support.

Co-Authored-By: Dodji Seketeli <dodji@redhat.com>

From-SVN: r180084
2011-10-17 11:59:40 +02:00
Tom Tromey
07a0b324eb Emit macro expansion related diagnostics
In this third instalment the diagnostic machinery -- when faced with
the virtual location of a token resulting from macro expansion -- uses
the new linemap APIs to unwind the stack of macro expansions that led
to that token and emits a [hopefully] more useful message than what we
have today.

diagnostic_report_current_module has been slightly changed to use the
location given by client code instead of the global input_location
variable.  This results in more precise diagnostic locations in
general but then the patch adjusts some C++ tests which output changed
as a result of this.

Three new regression tests have been added.

The mandatory screenshot goes like this:

[dodji@adjoa gcc]$ cat -n test.c
     1    #define OPERATE(OPRD1, OPRT, OPRD2) \
     2      OPRD1 OPRT OPRD2;
     3
     4    #define SHIFTL(A,B) \
     5      OPERATE (A,<<,B)
     6
     7    #define MULT(A) \
     8      SHIFTL (A,1)
     9
    10    void
    11    g ()
    12    {
    13      MULT (1.0);/* 1.0 << 1; <-- so this is an error.  */
    14    }

[dodji@adjoa gcc]$ ./cc1 -quiet -ftrack-macro-expansion test.c
test.c: In function 'g':
test.c:5:14: erreur: invalid operands to binary << (have 'double' and 'int')
test.c:2:9: note: in expansion of macro 'OPERATE'
test.c:5:3: note: expanded from here
test.c:5:14: note: in expansion of macro 'SHIFTL'
test.c:8:3: note: expanded from here
test.c:8:3: note: in expansion of macro 'MULT2'
test.c:13:3: note: expanded from here

Co-Authored-By: Dodji Seketeli <dodji@redhat.com>

From-SVN: r180083
2011-10-17 11:59:27 +02:00
Tom Tromey
92582b753e Generate virtual locations for tokens
This second instalment uses the infrastructure of the previous patch
to allocate a macro map for each macro expansion and assign a virtual
location to each token resulting from the expansion.

To date when cpp_get_token comes across a token that happens to be a
macro, the macro expander kicks in, expands the macro, pushes the
resulting tokens onto a "token context" and returns a dummy padding
token. The next call to cpp_get_token goes look into the token context
for the next token [which is going to result from the previous macro
expansion] and returns it.  If the token is a macro, the macro expander
kicks in and you know the story.

This patch piggy-backs on that macro expansion process, so to speak.
First it modifies the macro expander to make it create a macro map for
each macro expansion. It then allocates a virtual location for each
resulting token.  Virtual locations of tokens resulting from macro
expansions are then stored on a special kind of context called an
"expanded tokens context".  In other words, in an expanded tokens
context, there are tokens resulting from macro expansion and their
associated virtual locations.  cpp_get_token_with_location is modified
to return the virtual location of tokens resulting from macro
expansion.  Note that once all tokens from an expanded token context have
been consumed and the context and is freed, the memory used to store the
virtual locations of the tokens held in that context is freed as well.
This helps reducing the overall peak memory consumption.

The client code that was getting macro expansion point location from
cpp_get_token_with_location now gets virtual location from it. Those
virtual locations can in turn be resolved into the different
interesting physical locations thanks to the linemap API exposed by
the previous patch.

Expensive progress. Possibly. So this whole virtual location
allocation business is switched off by default. So by default no
extended token is created. No extended token context is created
either. One has to use -ftrack-macro-expansion to switch this on. This
complicates the code but I believe it can be useful as some of our
friends found out at http://llvm.org/bugs/show_bug.cgi?id=5610

The patch tries to reduce the memory consumption by freeing some token
context memory that was being reused before. I didn't notice any
compilation slow down due to this immediate freeing on my GNU/Linux
system.

As no client code tries to resolve virtual locations to anything but
what was being done before, no new test case has been added.

Co-Authored-By: Dodji Seketeli <dodji@redhat.com>

From-SVN: r180082
2011-10-17 11:59:12 +02:00
Tom Tromey
46427374e1 Linemap infrastructure for virtual locations
This is the first instalment of a set which goal is to track locations
of tokens across macro expansions.  Tom Tromey did the original work
and attached the patch to PR preprocessor/7263.  This opus is a
derivative of that original work.

This patch modifies the linemap module of libcpp to add virtual
locations support.

A virtual location is a mapped location that can resolve to several
different physical locations.  It can always resolve to the spelling
location of a token.  For tokens resulting from macro expansion it can
resolve to:
  - either the location of the expansion point of the macro.
  - or the location of the token in the definition of the
  macro
  - or, if the token is an argument of a function-like macro,
  the location of the use of the matching macro parameter in
  the definition of the macro

The patch creates a new type of line map called a macro map.  For every
single macro expansion, there is a macro map that generates a virtual
location for every single resulting token of the expansion.

The good old type of line map we all know is now called an ordinary
map.  That one still encodes spelling locations as it has always had.

As a result linemap_lookup as been extended to return a macro map when
given a virtual location resulting from a macro expansion.  The layout
of structs line_map has changed to support this new type of map.  So
did the layout of struct line_maps.  Accessor macros have been
introduced to avoid messing with the implementation details of these
datastructures directly.  This helped already as we have been testing
different ways of arranging these datastructure.  Having to constantly
adjust client code that is too tied with the internals of line_map and
line_maps would have been even more painful.

Of course, many new public functions have been added to the linemap
module to handle the resolution of virtual locations.

This patch introduces the infrastructure but no part of the compiler
uses virtual locations yet.

However the client code of the linemap data structures has been
adjusted as per the changes.  E.g, it's not anymore reliable for a
client code to manipulate struct line_map directly if it just wants to
deal with spelling locations, because struct line_map can now
represent a macro map as well.  In that case, it's better to use the
convenient API to resolve the initial (possibly virtual) location to a
spelling location (or to an ordinary map) and use that.

This is the reason why the patch adjusts the Java, Ada and Fortran
front ends.

Also, note that virtual locations are not supposed to be ordered for
relations '<' and '>' anymore.  To test if a virtual location appears
"before" another one, one has to use a new operator exposed by the
line map interface.  The patch updates the only spot (in the
diagnostics module) I have found that was making the assumption that
locations were ordered for these relations.  This is the only change
that introduces a use of the new line map API in this patch, so I am
adding a regression test for it only.

From-SVN: r180081
2011-10-17 11:58:56 +02:00
Paolo Carlini
2be4314f3d re PR c++/48489 (Invalid error message 'has no member named' when referring directly to the base class)
/cp
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/48489
	* typeck.c (finish_class_member_access_expr): Fix error call
	for TREE_CODE (access_path) == TREE_BINFO.

/testsuite
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/48489
	* g++.dg/inherit/error5.C: New.

From-SVN: r180080
2011-10-17 09:48:02 +00:00
Janus Weil
fbe468a522 re PR fortran/47023 (C_Sizeof: Rejects valid code)
2011-10-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47023
	PR fortran/50752
	* primary.c (match_kind_param): Avoid segfault.


2011-10-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47023
	PR fortran/50752
	* gfortran.dg/kind_tests_4.f90: New.

From-SVN: r180079
2011-10-17 11:46:30 +02:00
Ira Rosen
a7fc89c1b8 vect-21.c: Expect the loops to get vectorized on targets that support vector condition.
* gcc.dg/vect/vect-21.c: Expect the loops to get vectorized on
        targets that support vector condition.

From-SVN: r180076
2011-10-17 08:40:14 +00:00
GCC Administrator
68fb6054a4 Daily bump.
From-SVN: r180071
2011-10-17 00:18:35 +00:00
Andi Kleen
6c995fa54c Increase the GGC quire size to 2MB
gcc/:

2011-10-08  Andi Kleen  <ak@linux.intel.com>

	* ggc-page.c (GGC_QUIRE_SIZE): Increase to 512

From-SVN: r180066
2011-10-16 23:24:12 +00:00
Andi Kleen
5958009b73 Add error checking to lto_section_read
gcc/lto/:

2011-10-09  Andi Kleen  <ak@linux.intel.com>

	* lto.c (lto_section_read): Call fatal_error on IO or mmap errors.

From-SVN: r180065
2011-10-16 23:22:32 +00:00
Andi Kleen
b74bdc6145 Rename __gnu_slim_lto to __gnu_lto_slim
gcc/:

2011-10-13  Andi Kleen  <ak@linux.intel.com>

	* toplev.c (compile_file): Rename __gnu_slim_lto to __gnu_lto_slim.

From-SVN: r180064
2011-10-16 23:10:47 +00:00
Thomas Koenig
930d4d4e23 frontend-passes.c (current_ns): Make static.
2011-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* frontend-passes.c (current_ns):  Make static.
	(create_var):  Note parent of newly created namespace.
	(optimize_namespace):  Don't wak sibling namespaces
	if they are EXEC_BLOCK because this is handled...
	(gfc_code_walker):  ... here.  Also walk ASSOCIATE lists.

From-SVN: r180063
2011-10-16 22:06:19 +00:00
Janus Weil
bee64a2b9e re PR fortran/47023 (C_Sizeof: Rejects valid code)
2011-10-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47023
	* primary.c (match_kind_param): Detect ISO_C_BINDING kinds.
	(get_kind): Pass on 'is_iso_c' flag.
	(match_integer_constant,match_real_constant,match_logical_constant):
	Set 'ts.is_c_interop'.


2011-10-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47023
	* gfortran.dg/c_kind_tests_3.f03: New.

From-SVN: r180062
2011-10-16 21:42:48 +02:00
Janus Weil
fe445bf7be re PR fortran/50547 (dummy procedure argument of PURE shall be PURE)
2011-10-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50547
	* resolve.c (resolve_formal_arglist): Remove unneeded error message.
	Some reshuffling.

2011-10-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50547
	* gfortran.dg/elemental_args_check_4.f90: New.

From-SVN: r180061
2011-10-16 21:16:59 +02:00
Ira Rosen
aede122782 re PR tree-optimization/50727 (ICE with segfault in flow_bb_inside_loop_p)
PR tree-optimization/50727
        * tree-vect-patterns.c (vect_operation_fits_smaller_type): Add
        DEF_STMT to the list of statements to be replaced by the
        pattern statements.

From-SVN: r180060
2011-10-16 13:47:54 +00:00
Eric Botcazou
a1f6ecb6d6 Move testsuite entries to proper file
From-SVN: r180059
2011-10-16 13:17:29 +00:00
Eric Botcazou
bd8c998f35 re PR rtl-optimization/50615 (ICE: in distribute_notes, at combine.c:13282 with -O --param max-cse-insns=1)
PR rtl-optimization/50615
	* combine.c (distribute_notes) <REG_ARGS_SIZE>: Skip if I3 is a no-op.

From-SVN: r180058
2011-10-16 13:14:34 +00:00
Jakub Jelinek
71c92d1778 re PR tree-optimization/50596 (Problems in vectorization of condition expression)
PR tree-optimization/50596
	* tree-vectorizer.h (NUM_PATTERNS): Increase to 7.
	* tree-vect-patterns.c (vect_vect_recog_func_ptrs): Add
	vect_recog_bool_pattern.
	(check_bool_pattern, adjust_bool_pattern_cast,
	adjust_bool_pattern, vect_recog_bool_pattern): New functions.

	* gcc.dg/vect/vect-cond-9.c: New test.

From-SVN: r180057
2011-10-16 15:10:20 +02:00
Arnaud Charlet
ea10ca9c75 [multiple changes]
2011-10-16  Tristan Gingold  <gingold@adacore.com>

	* link.c (_AIX): Add support for GNU ld.        

2011-10-16  Fedor Rybin  <frybin@adacore.com>

	* gnat_ugn.texi: Fixing gnattest example names in the doc.
	Adding explanation to additional tests usage.

2011-10-16  Robert Dewar  <dewar@adacore.com>

	* exp_ch6.adb, sem_ch6.adb: Minor reformatting.

2011-10-16  Eric Botcazou  <ebotcazou@adacore.com>

	* a-convec.adb: Fix minor inconsistencies.

2011-10-16  Matthew Heaney  <heaney@adacore.com>

	* a-cusyqu.ads, a-cbsyqu.ads, a-cuprqu.ads, a-cbprqu.ads (package
	Implementation): Specify pragma Implementation_Defined.

From-SVN: r180056
2011-10-16 14:12:11 +02:00
Ira Rosen
6aa904c4c6 tree-vect-stmts.c (vectorizable_load): For SLP without permutation treat the first load of the node as the first...
* tree-vect-stmts.c (vectorizable_load): For SLP without
        permutation treat the first load of the node as the first
        element in its interleaving chain.
        * tree-vect-slp.c (vect_get_and_check_slp_defs): Swap the
        operands if necessary and possible.
        (vect_build_slp_tree): Add new argument.  Allow load groups of
        any size in basic blocks.  Keep all the loads for further
        permutation check.  Use the new argument to determine if there
        is a permutation.  Update the recursive calls.
        (vect_supported_load_permutation_p): Allow subchains of
        interleaving chains in basic block vectorization.
        (vect_analyze_slp_instance): Update the call to
        vect_build_slp_tree.  Check load permutation based on the new
        parameter.
        (vect_schedule_slp_instance): Don't start from the first element
        in interleaving chain unless the loads are permuted.

From-SVN: r180055
2011-10-16 10:47:12 +00:00
Jan Hubicka
1bb7e8f8fe re PR middle-end/48668 (COMDAT Group signature not emitted in group)
PR target/48668
	PR target/50689
	* cgraphunit.c (cgraph_expand_function): Expand thunks and alises
	after function body.

From-SVN: r180053
2011-10-16 09:02:33 +00:00
GCC Administrator
7a2a89e864 Daily bump.
From-SVN: r180052
2011-10-16 00:17:57 +00:00
Paolo Carlini
4f75413f5e re PR c++/50732 ([type_traits] is_base_of<Base, Derived> unnecessarily instantiates Base (which shouldn't be instantiated))
/cp
2011-10-15  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50732
	* semantics.c (finish_trait_expr): Do not try to instantiate the
	the base type of an __is_base_of trait.
	(check_trait_type): Return a tree; use complete_type_or_else.

/testsuite
2011-10-15  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50732
	* g++.dg/ext/is_base_of_incomplete.C: New.
	* g++.dg/ext/is_base_of_diagnostic.C: Adjust dg-errors.
	* g++.dg/ext/unary_trait_incomplete.C: Likewise.

From-SVN: r180048
2011-10-15 19:49:33 +00:00
Richard Henderson
2635892a1c Use VEC_PERM_EXPR in the vectorizer.
* tree-vect-slp.c: Include langhooks.h.
        (vect_create_mask_and_perm): Emit VEC_PERM_EXPR, not a builtin.
        (vect_transform_slp_perm_load): Use can_vec_perm_expr_p.  Simplify
        mask creation for VEC_PERM_EXPR.
        * tree-vect-stmts.c (perm_mask_for_reverse): Return the mask,
        not the builtin.
        (reverse_vec_elements): Emit VEC_PERM_EXPR not a builtin.
        * Makefile.in (tree-vect-slp.o): Update dependency.
        * optabs.c (can_vec_perm_expr_p): Allow NULL as unknown constant.

From-SVN: r180047
2011-10-15 12:36:50 -07:00