2015-11-30 Venkataramanan Kumar <Venkataramanan.Kumar@amd.com>
* tree-if-conv.c (struct ifc_dr): Add new tree
base_predicate field.
(hash_memrefs_baserefs_and_store_DRs_read_written_info): Hash
base ref, DR pairs and store base_predicate for write type DRs.
(ifcvt_memrefs_wont_trap): Guard checks with
-ftree-loop-if-convert-stores flag.
From-SVN: r231057
* cgraph.c (cgraph_node::make_local): No name is unique during
incremental linking.
* cgraph.h (can_be_discarded_p): Update comment; also common and
WEAK in named sections can be discarded; when doing incremental
link do not rely on resolution being the final one.
* varasm.c (default_binds_local_p_3, decl_binds_to_current_def_p):
When symbol can be discarded, do not rely on resolution info.
* symtab.c (symtab_node::nonzero_address): Take into account that
symbol can be discarded.
* ipa-visibility.c (update_visibility_by_resolution_info): Handle
definition correctly.
(function_and_variable_visibility): Do not set unique_name when
incrementally linking.
From-SVN: r231050
PR c/67581
* g++.dg/torture/pr67581.C: New testcase.
* c-family/c-common.c (handle_transparent_union_attribute): Update
also type variants.
From-SVN: r231048
PR target/28115
* config/rs6000/rs6000.c (rs6000_adjust_cost): Correct
recog_memoized test for insn and check recog_memoized for dep_insn.
From-SVN: r231045
* doc/invoke.texi (Option Summary): Use negative form of
-Waggressive-loop-optimizations, remove redundant -Wpedantic-ms-format,
sort alphabetically and re-justify.
From-SVN: r231022
The fix for bug 59195:
[C++ demangler handles conversion operator incorrectly]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59195
unfortunately makes the demangler crash due to infinite recursion, in
case of casts in template parameters.
For example, with:
template<int> struct A {};
template <typename Y> void function_temp(A<sizeof ((Y)(999))>) {}
template void function_temp<int>(A<sizeof (int)>);
The 'function_temp<int>' instantiation above mangles to:
_Z13function_tempIiEv1AIXszcvT_Li999EEE
The demangler parses this as:
typed name
template
name 'function_temp'
template argument list
builtin type int
function type
builtin type void
argument list
template (*)
name 'A'
template argument list
unary operator
operator sizeof
unary operator
cast
template parameter 0 (**)
literal
builtin type int
name '999'
And after the fix for 59195, due to:
static void
d_print_cast (struct d_print_info *dpi, int options,
const struct demangle_component *dc)
{
...
/* For a cast operator, we need the template parameters from
the enclosing template in scope for processing the type. */
if (dpi->current_template != NULL)
{
dpt.next = dpi->templates;
dpi->templates = &dpt;
dpt.template_decl = dpi->current_template;
}
when printing the template argument list of A (what should be "<sizeof
(int)>"), the template parameter 0 (that is, "T_", the '**' above) now
refers to the first parameter of the the template argument list of the
'A' template (the '*' above), exactly what we were already trying to
print. This leads to infinite recursion, and stack exaustion. The
template parameter 0 should actually refer to the first parameter of
the 'function_temp' template.
Where it reads "for the cast operator" in the comment in d_print_cast
(above), it's really talking about a conversion operator, like:
struct A { template <typename U> explicit operator U(); };
We don't want to inject the template parameters from the enclosing
template in scope when processing a cast _expression_, only when
handling a conversion operator.
The problem is that DEMANGLE_COMPONENT_CAST is currently ambiguous,
and means _both_ 'conversion operator' and 'cast expression'.
Fix this by adding a new DEMANGLE_COMPONENT_CONVERSION component type,
which does what DEMANGLE_COMPONENT_CAST does today, and making
DEMANGLE_COMPONENT_CAST just simply print its component subtree.
I think we could instead reuse DEMANGLE_COMPONENT_CAST and in
d_print_comp_inner still do:
@@ -5001,9 +5013,9 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
d_print_comp (dpi, options, dc->u.s_extended_operator.name);
return;
case DEMANGLE_COMPONENT_CAST:
d_append_string (dpi, "operator ");
- d_print_cast (dpi, options, dc);
+ d_print_conversion (dpi, options, dc);
return;
leaving the unary cast case below calling d_print_cast, but seems to
me that spliting the component types makes it easier to reason about
the code.
g++'s testsuite actually generates three symbols that crash the
demangler in the same way. I've added those as tests in the demangler
testsuite as well.
And then this fixes PR other/61233 too, which happens to be a
demangler crash originally reported to GDB, at:
https://sourceware.org/bugzilla/show_bug.cgi?id=16957
Bootstrapped and regtested on x86_64 Fedora 20.
Also ran this through GDB's testsuite. GDB will require a small
update to use DEMANGLE_COMPONENT_CONVERSION in one place it's using
DEMANGLE_COMPONENT_CAST in its sources.
libiberty/
2015-11-27 Pedro Alves <palves@redhat.com>
PR other/61321
PR other/61233
* demangle.h (enum demangle_component_type)
<DEMANGLE_COMPONENT_CONVERSION>: New value.
* cp-demangle.c (d_demangle_callback, d_make_comp): Handle
DEMANGLE_COMPONENT_CONVERSION.
(is_ctor_dtor_or_conversion): Handle DEMANGLE_COMPONENT_CONVERSION
instead of DEMANGLE_COMPONENT_CAST.
(d_operator_name): Return a DEMANGLE_COMPONENT_CONVERSION
component if handling a conversion.
(d_count_templates_scopes, d_print_comp_inner): Handle
DEMANGLE_COMPONENT_CONVERSION.
(d_print_comp_inner): Handle DEMANGLE_COMPONENT_CONVERSION instead
of DEMANGLE_COMPONENT_CAST.
(d_print_cast): Rename as ...
(d_print_conversion): ... this. Adjust comments.
(d_print_cast): Rewrite - simply print the left subcomponent.
* cp-demint.c (cplus_demangle_fill_component): Handle
DEMANGLE_COMPONENT_CONVERSION.
* testsuite/demangle-expected: Add tests.
From-SVN: r231020
Revert
2015-11-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* ifcvt.c (insn_valid_noce_process_p): Reject insn if it satisfies
multiple_sets.
(noce_try_cmove_arith): Add checking asserts that orig_a and orig_b
are not modified by the final modified insns in the basic blocks.
From-SVN: r231019
* ifcvt.c (insn_valid_noce_process_p): Reject insn if it satisfies
multiple_sets.
(noce_try_cmove_arith): Add checking asserts that orig_a and orig_b
are not modified by the final modified insns in the basic blocks.
From-SVN: r231004
PR tree-optimization/68552
* optabs.c (expand_vec_perm_1): Move vec_shr handling from here...
(expand_vec_perm): ... here. Do it regardless of vec_perm_const_optab
or whether v0 == v1.
From-SVN: r231000
PR c/63326
* c-parser.c (c_parser_compound_statement_nostart): If
last_label is true, use pragma_stmt instead of pragma_compound
as second c_parser_pragma argument.
(c_parser_omp_ordered, c_parser_omp_target_update,
c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Pass
false as second argument to c_parser_skip_to_pragma_eol after
diagnosing standalone directives used in pragma_stmt context.
* parser.c (cp_parser_statement): Clear in_compound after labels.
* gcc.dg/gomp/barrier-2.c (f2): Expect another error after label.
* c-c++-common/gomp/pr63326.c: New test.
* testsuite/libgomp.c/cancel-parallel-2.c (foo): Add semicolon
in between case label and OpenMP standalone directives.
* testsuite/libgomp.c++/cancel-parallel-2.C (foo): Likewise.
From-SVN: r230999
* tree-vect-loop-manip.c (vect_create_cond_for_alias_checks):
Do not release memory for comp_alias_ddrs.
* tree-vect-loop.c (destroy_loop_vec_info): Release
the memory for all loop_vec_info.
From-SVN: r230995
Storing a register in memory as a full word and then accessing the
same memory address under a smaller-than-word mode amounts to
right-shifting of the register word on big endian machines. So, if
BLOCK_REG_PADDING chooses upward padding for BYTES_BIG_ENDIAN, and
we're copying from the entry_parm REG directly to a pseudo, bypassing
any stack slot, perform the shifting explicitly.
This fixes the miscompile of function_return_val_10 in
gcc.target/aarch64/aapcs64/func-ret-4.c for target aarch64_be-elf
introduced in the first patch for 67753.
for gcc/ChangeLog
PR rtl-optimization/67753
PR rtl-optimization/64164
* function.c (assign_parm_setup_block): Right-shift
upward-padded big-endian args when bypassing the stack slot.
From-SVN: r230985
Move the `-mcompact-branches=' option out of the middle of a block of
floating-point options. The option is not related to FP in any way.
Place it immediately below other branch instruction selection options.
* doc/invoke.texi (Option Summary) <MIPS Options>: Reorder
`-mcompact-branches='.
(MIPS Options): Likewise.
From-SVN: r230984
gcc/cp/ChangeLog:
2015-11-26 Andreas Arnez <arnez@linux.vnet.ibm.com>
* cp-gimplify.c (genericize_cp_loop): Change LOOP_EXPR's location
to start of loop body instead of start of loop.
gcc/testsuite/ChangeLog:
2015-11-26 Andreas Arnez <arnez@linux.vnet.ibm.com>
* g++.dg/guality/pr67192.C: New test.
From-SVN: r230979