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
2012-12-07 Martin Jambor <mjambor@suse.cz>
PR middle-end/55078
* ipa-inline-transform.c (inline_call): Turn #if 0 to #ifdef
ENABLE_CHECKING.
* ipa-prop.c (try_make_edge_direct_simple_call): Use
ipa_value_from_jfunc.
(try_make_edge_direct_virtual_call): Likewise.
(update_indirect_edges_after_inlining): Lookup new_root_info and pass
it to the functions above.
From-SVN: r194301
2012-12-07 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55590
* tree-sra.c (build_ref_for_offset): Use get_object_alignment_1 to
get base alignment.
* testsuite/gcc.target/i386/pr55590-1.c: New test.
* testsuite/gcc.target/i386/pr55590-2.c: Likewise.
From-SVN: r194300
PR target/55597
* config/i386/i386.c (legitimize_tls_address): Zero-extend x to Pmode,
before using it as insn or call equivalent.
testsuite/ChangeLog:
PR target/55597
* gcc.target/i386/pr55597.c: New test.
From-SVN: r194274
PR c++/54744
* pt.c (resolve_typename_type): Check TYPENAME_IS_RESOLVING_P on scope.
* init.c (expand_member_init): Check for being in a template first.
* parser.c (cp_parser_mem_initializer_list): Only check class types
for equivalence to the current class.
From-SVN: r194267
PR c++/54947
* parser.c (cp_parser_initializer_list): Don't require an
expression in [] to be constant until we know it's a C99
designator.
From-SVN: r194256
PR middle-end/43631
* var-tracking.c (emit_note_insn_var_location, emit_notes_in_bb):
Clear BLOCK_FOR_INSN on notes emitted in between basic blocks,
don't adjust BB_END when inserting note after BB_END of some bb.
From-SVN: r194252
PR c++/55137
* fold-const.c (fold_binary_loc) <associate>: Don't introduce
TREE_OVERFLOW through reassociation. If type doesn't have defined
overflow, but one or both of the operands do, use the wrapping type
for reassociation and only convert to type at the end.
* g++.dg/opt/pr55137.C: New test.
* gcc.c-torture/execute/pr55137.c: New test.
From-SVN: r194250
PR rtl-optimization/55604
* lra-lives.c (lra_create_live_ranges): If there are no referenced
pseudos left, do not compute live ranges.
From-SVN: r194230
PR target/54160
* config/t-darwin (darwin-c.o): Depend on $(CPP_INTERNAL_H).
* config/darwin-c.c (darwin_cpp_builtins): Only set __OBJC2__
when in obj mode.
Include libcpp/internal.h.
From-SVN: r194227