2012-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/52909
* trans-decl.c (get_proc_pointer_decl): Apply name mangling.
2012-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/52909
* gfortran.dg/proc_ptr_39.f90: New test case.
From-SVN: r194375
PR lto/55466
* lto-symtab.c (lto_symtab_merge_decls_1): Don't record the
prevailing variable.
* lto.c (lto_register_var_decl_in_symtab): Don't record static
variables.
(lto_main): Record the global variables if WPA isn't enabled.
From-SVN: r194359
2012-12-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/55107
* tree-ssa-pre.c (struct pre_stats): Remove constified field.
(bitmap_set_replace_value): Add gcc_unreachable.
(do_regular_insertion): Re-write all_same handling. Insert
an assignment instead of a PHI in this case.
(eliminate_bb): Record availability also for SSA names defined
by a constant.
(do_pre): Do not record constified events.
(execute_fre): Likewise.
* gcc.dg/torture/pr55107.c: New testcase.
* gcc.dg/tree-ssa/ssa-pre-5.c: Adjust.
From-SVN: r194358
* asan.c (asan_init_shadow_ptr_types): Move earlier in the file.
Call initialize_sanitizer_builtins at the end.
(asan_pp_string): Use TREE_TYPE (shadow_ptr_types[0])
as character type instead of char_type_node.
(asan_emit_stack_protection): Call asan_init_shadow_ptr_types
if shadow_ptr_types isn't initialized.
(asan_protect_global): Return true for STRING_CSTs except those
created by asan_pp_string.
(count_string_csts, add_string_csts): New functions.
(struct asan_add_string_csts_data): New type.
(asan_finish_file): Clear flag_asan at the beginning, restore at the
end. Traverse constant_pool_htab () to look for protected
STRING_CSTs. Don't call initialize_sanitizer_builtins,
instead call asan_init_shadow_ptr_types if shadow_ptr_types isn't
initialized yet.
(asan_instrument): Don't call initialize_sanitizer_builtins.
* varasm.c (output_constant_def_contents): If STRING_CST should be
asan protected, align it sufficiently and emit padding after it.
(categorize_decl_for_section): If flag_asan, don't put STRING_CSTs
that should be asan protected into mergeable sections. For
-fmerge-all-constants, ignore it for -fmudflap or if decl is
asan protected.
From-SVN: r194355
2012-12-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55593
* frontend-passes.c (doloop_code): Use resolved_sym
instead of n.sym->formal for formal argument list
to get the correct version for all generic subroutines.
2012-12-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55593
* gfortran.dg/do_check_8.f90: New test.
From-SVN: r194329
PR rtl-optimization/55158
* sched-rgn.c (bb_state_array, bb_state): Add some explaining
comment, and initialize to NULL explicitly.
(realloc_bb_state_array): New function.
(free_bb_state_array): New function.
(schedule_region): Call realloc_bb_state_array after schedule_block.
(sched_rgn_init): Use realloc_bb_state_array to initialize bb_state.
(sched_rgn_finish): Use free_bb_state_array to free it.
From-SVN: r194322
2012-12-07 Sriraman Tallan <tmsriram@google.com>
* toplev.c (process_options): Do not warn when -ffunction-sections
and -fprofile are used together.
From-SVN: r194311
Consider this invalid example given in the PR, where T is not defined:
1 template<typename>
2 struct X {
3 using type = T;
4 };
g++ yields the confusing diagnostics:
test.cc:3:10: error: expected nested-name-specifier before 'type'
using type = T;
^
test.cc:3:10: error: using-declaration for non-member at class scope
test.cc:3:15: error: expected ';' before '=' token
using type = T;
^
test.cc:3:15: error: expected unqualified-id before '=' token
I think this is because in cp_parser_member_declaration we tentatively
parse an alias declaration; we then have a somewhat meaningful
diagnostic which alas is not emitted because we are parsing
tentatively. As the parsing didn't succeed (because the input is
invalid) we try to parse a using declaration, which fails as well; but
then the diagnostic emitted is the one for the failed attempt at
parsing a using declaration, not an alias declaration. Oops.
The idea of this patch is to commit the tentative parse when we see
the '=' token in the alias-declaration. That way any error encounter
after that token is reported to the user.
We are now getting the following output:
test.cc:3:18: erreur: expected type-specifier before ‘T’
using type = T;
^
test.cc:3:18: erreur: ‘T’ does not name a type
I don't really like the "before 'T'" there, but I think we maybe could
revisit the format of what cp_parser_error emits in general, now that
we have caret diagnostics; We could maybe do away with the "before T"
altogether?
In the mean time, it seems to me that this patch brings an improvement
over what we already have in trunk, and the issue above could be
addressed separately.
Tested on x86_64-unknown-linux-gnu against trunk.
gcc/cp/
* parser.c (cp_parser_alias_declaration): Commit to tentative
parse when see the '=' token. Get out if the type-id is invalid.
Update function comment.
(cp_parser_member_declaration): Don't try to parse a using
declaration if we know that we expected an alias declaration; that
is, if we see the '=' token after the identifier.
gcc/testsuite/
* g++.dg/cpp0x/alias-decl-28.C: New test.
* g++.dg/cpp0x/alias-decl-16.C: Update.
From-SVN: r194306