2012-05-29 Iain Sandoe <iains@gcc.gnu.org>
* config/darwin.h (STARTFILE_SPEC): Do not use -lbundle1.o when
Darwin >= 10.
(DARWIN_DYLIB1_SPEC): Do not use -ldylib1.10.5.o when Darwin >= 10.
(DARWIN_CRT1_SPEC): Use -lcrt1.10.6.o when Darwin >= 10.
From-SVN: r187992
PR target/52941
* config/sh/predicates.md (atomic_arith_operand,
atomic_logical_operand): New predicates.
* config/sh/sh.c (sh_option_override): Check atomic options.
* config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS,
UNSUPPORTED_HARD_ATOMIC_CPU): New macros.
(DRIVER_SELF_SPECS): Use UNSUPPORTED_ATOMIC_OPTIONS and
UNSUPPORTED_HARD_ATOMIC_CPU.
* config/sh/sync.md: Update description comments.
(I12): New mode iterator.
(fetchop_predicate, fetchop_constraint): New code attributes.
(atomic_compare_and_swapsi_hard, atomic_compare_and_swap<mode>_hard,
atomic_exchangesi_hard, atomic_exchange<mode>_hard,
atomic_fetch_<fetchop_name>si_hard,
atomic_fetch_<fetchop_name><mode>_hard,
atomic_fetch_nandsi_hard, atomic_fetch_nand<mode>_hard,
atomic_<fetchop_name>_fetchsi_hard,
atomic_<fetchop_name>_fetch<mode>_hard,
atomic_nand_fetchsi_hard, atomic_nand_fetch<mode>_hard,
atomic_test_and_set_hard): New insns.
(atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft,
atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft,
atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft,
atomic_test_and_set_soft): Use same formatting for the first line of
the asm block as in new insns above.
(atomic_compare_and_swap<mode>, atomic_exchange<mode>,
atomic_fetch_<fetchop_name><mode>, atomic_<fetchop_name>_fetch<mode>,
atomic_test_and_set): Integrate new *_hard insns into expanders.
* config/sh/sh.opt (mhard-atomic): New option.
* doc/invoke.texi (SH Options): Document it.
From-SVN: r187987
2012-05-29 Meador Inge <meadori@codesourcery.com>
* c-decl.c (c_push_function_context): Always create a new language
function.
(c_pop_function_context): Clear the language function created in
c_push_function_context.
From-SVN: r187979
2012-05-29 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (find_vars_r): Do not call add_referenced_vars
for globals.
(add_referenced_var_1): Re-organize. Assert we are not
called for globals.
(remove_referenced_var): Likewise.
* varpool.c (add_new_static_var): Use create_tmp_var_raw.
* tree-mudflap.c (execute_mudflap_function_ops): Do not
call add_referenced_var on globals.
* matrix-reorg.c (transform_access_sites): Likewise.
From-SVN: r187955
* alias.c (reg_known_value): Make this a VEC.
(reg_known_equiv_p): Make this an sbitmap.
(reg_known_value_size): Remove.
(get_reg_known_value, set_reg_known_value, get_reg_known_equiv_p,
set_reg_known_equiv_p): Update for reg_known_value and
reg_known_value_size data structure change.
(init_alias_analysis, end_alias_analysis): Likewise.
From-SVN: r187953
PR middle-end/53510
* input.c (read_line): Use XRESIZEVEC instead of XNEWVEC
to avoid leaking memory. No need to handle memory allocation
failure. Double string_len on each reallocation instead of
adding 2.
* gcov.c (read_line): Likewise.
From-SVN: r187952
As stated in the audit trail of this problem report, consider this
test case:
$ cat test.c
1 struct x {
2 int i;
3 };
4 struct x x;
5
6 #define TEST(X) x.##X
7
8 void foo (void)
9 {
10 TEST(i) = 0;
11 }
$
$ cc1 -quiet test.c
test.c: In function 'foo':
test.c:10:1: error: pasting "." and "i" does not give a valid preprocessing token
TEST(i) = 0;
^
$
So, when pasting tokens, the error diagnostic uses the global and
imprecise input_location variable, leading to an imprecise output.
To properly fix this, I think libcpp should keep the token of the
pasting operator '##', instead of representing it with flag on the LHS
operand's token. That way, it could use its location. Doing that
would be quite intrusive though. So this patch just uses the location
of the LHS of the pasting operator, for now. It's IMHO better than
the current situation.
The patch makes paste_tokens take a location parameter that is used in
the diagnostics. This change can still be useful later when we can
use the location of the pasting operator, because paste_tokens will
just be passed the new, more precise location.
Incidentally, it appeared that when getting tokens from within
preprocessor directives (like what is done in gcc.dg/cpp/paste12.c),
with -ftrack-macro-expansion disabled, the location of the expansion
point of macros was being lost because
cpp_reader::set_invocation_location wasn't being properly set. It's
because when cpp_get_token_1 calls enter_macro_context, there is a
little period of time between the beginning of that later function and
when the macro is really pushed (and thus when the macro is really
expanded) where we wrongly consider that we are not expanding the
macro because macro_of_context is still NULL. In that period of time,
in the occurrences of indirect recursive calls to cpp_get_token_1,
this later function wrongly sets cpp_reader::invocation_location
because cpp_reader::set_invocation_location is not being properly set.
To avoid that confusion the patch does away with
cpp_reader::set_invocation_location and introduces a new flag
cpp_reader::about_to_expand_macro_p that is set in the small time
interval exposed earlier. A new in_macro_expansion_p is introduced as
well, so that cpp_get_token_1 can now accurately detect when we are in
the process of expanding a macro, and thus correctly collect the
location of the expansion point.
People seem to like screenshots.
Thus, after the patch, we now have:
$ cc1 -quiet test.c
test.c: In function 'foo':
test.c:6:18: error: pasting "." and "i" does not give a valid preprocessing token
#define TEST(X) x.##X
^
test.c:10:3: note: in expansion of macro 'TEST'
TEST(i) = 0;
^
$
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
libcpp/
PR preprocessor/53229
* internal.h (cpp_reader::set_invocation_location): Remove.
(cpp_reader::about_to_expand_macro_p): New member flag.
* directives.c (do_pragma): Remove Kludge as
pfile->set_invocation_location is no more.
* macro.c (cpp_get_token_1): Do away with the use of
cpp_reader::set_invocation_location. Just collect the macro
expansion point when we are about to expand the top-most macro.
Do not override cpp_reader::about_to_expand_macro_p.
This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
properly handle locations of expansion points.
(cpp_get_token_with_location): Adjust, as
cpp_reader::set_invocation_location is no more.
(paste_tokens): Take a virtual location parameter for
the LHS of the pasting operator. Use it in diagnostics. Update
comments.
(paste_all_tokens): Tighten the assert. Propagate the location of
the expansion point when no virtual locations are available.
Pass the virtual location to paste_tokens.
(in_macro_expansion_p): New static function.
(enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
flag until we really start expanding the macro.
gcc/testsuite/
PR preprocessor/53229
* gcc.dg/cpp/paste6.c: Force to run without
-ftrack-macro-expansion.
* gcc.dg/cpp/paste8.c: Likewise.
* gcc.dg/cpp/paste8-2.c: New test, like paste8.c but run with
-ftrack-macro-expansion.
* gcc.dg/cpp/paste12.c: Force to run without
-ftrack-macro-expansion.
* gcc.dg/cpp/paste12-2.c: New test, like paste12.c but run with
-ftrack-macro-expansion.
* gcc.dg/cpp/paste13.c: Likewise.
* gcc.dg/cpp/paste14.c: Likewise.
* gcc.dg/cpp/paste14-2.c: New test, like paste14.c but run with
-ftrack-macro-expansion.
* gcc.dg/cpp/paste18.c: New test.
From-SVN: r187945
2012-05-27 Janne Blomqvist <jb@gcc.gnu.org>
* intrinsics/time_1.h (gf_cputime): Don't reevaluate HZ expression
for times fallback, clarify operation ordering for times and clock
fallbacks.
(gf_gettime): Fix comment typo.
From-SVN: r187922
* cfgcleanup.c (try_optimize_cfg): Do not delete forwarder blocks
if CLEANUP_NO_INSN_DEL.
* cfgrtl.c (unique_locus_on_edge_between_p): New function extracted
from cfg_layout_merge_blocks.
(emit_nop_for_unique_locus_between): New function.
(rtl_merge_blocks): Invoke emit_nop_for_unique_locus_between.
(cfg_layout_merge_blocks): Likewise.
From-SVN: r187913
2012-05-26 Dimitrios Apostolou <jimis@gmx.net>
Paolo Bonzini <bonzini@gnu.org>
* df-scan.c (df_def_record_1): Assert a parallel must contain an
EXPR_LIST at this point. Receive the LOC and move its extraction...
(df_defs_record): ... here. Change if-else to a switch statement.
(df_find_hard_reg_defs, df_find_hard_reg_defs_1): New.
(df_get_call_refs): Changed defs_generated from bitmap to HARD_REG_SET
and compute it from df_find_hard_reg_defs(). Record DF_REF_BASE
DEFs in REGNO order. Use HARD_REG_SET instead of bitmap for
regs_invalidated_by_call.
(df_insn_refs_collect): Record DF_REF_REGULAR DEFs after
df_get_call_refs().
Co-Authored-By: Paolo Bonzini <bonzini@gnu.org>
From-SVN: r187911
* gcc-interface/decl.c (variant_desc): Rename 'record' to 'new_type'.
(build_variant_list): Adjust to above renaming.
(gnat_to_gnu_entity) <E_Record_Subtype>: Likewise. Give a unique name
to the type of the variant containers.
(create_variant_part_from): Likewise. Give a unique name to the type
of the variant part.
From-SVN: r187908
/cp
2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/32054
* parser.c (cp_parser_member_declaration): A storage class is not
allowed in a declaration of an anonymous aggregate in a class scope.
/testsuite
2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/32054
* g++.dg/other/anon-union3.C: New.
From-SVN: r187902