* gcc-interface/trans.c (gnat_to_gnu) <N_Expression_With_Actions>: Do
not translate the Etype of the node before translating the Actions.
From-SVN: r195368
Consider this example:
1 template<class...I> struct List {};
2 template<int T> struct Z {static const int value = T;};
3 template<int...T> using LZ = List<Z<T>...>;
4
5 template<class...U>
6 struct F
7 {
8 using N = LZ<U::value...>; //#1 This should amount to List<Z<U::value>...>
9 }
10
11 F<Z<1>, Z<2> >::N A; //#2
which G++ fails to compile, with this error message:
test-PR53609-3.cc: In instantiation of 'struct F<Z<1>, Z<2> >':
test-PR53609-3.cc:11:15: required from here
test-PR53609-3.cc:3:43: error: wrong number of template arguments (2, should be 1)
template<int...T> using LZ = List<Z<T>...>;
^
test-PR53609-3.cc:2:24: error: provided for 'template<int T> struct Z'
template<int T> struct Z {static const int value = T;};
I think this is because in #1, when we substitute the argument pack
{U::value...} into the pack expansion Z<T>..., tsubst_pack_expansion
yields Z<U::value...>, instead of Z<U::value>..., so the instantiation
of LZ amounts to List<Z<U::value...> >, instead of
List<Z<U::value>...>.
The idea of this patch is to make tsubst_pack_expansion support
substituting an argument pack (into a pack expansion) where one of the
arguments (let's call it the Ith argument) is itself a pack expansion
P. In that case, the Ith element resulting from the substituting
should be a pack expansion P'.
The pattern of P' is then the pattern of P into which the pattern of
the Ith argument of the argument pack has been substituted.
Tested on x86_64-unknown-linux-gnu against trunk.
gcc/cp/
* pt.c (argument_pack_element_is_expansion_p)
(make_argument_pack_select, use_pack_expansion_extra_args_p)
(gen_elem_of_pack_expansion_instantiation): New static functions.
(tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
look through the possibly resulting pack expansion as well.
(tsubst_pack_expansion): Use use_pack_expansion_extra_p to
generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
Use gen_elem_of_pack_expansion_instantiation to build the
instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
as gen_elem_of_pack_expansion_instantiation and the change in
tsubst above generalize this particular case.
(arg_from_parm_pack_p): Remove this for it's not used by
tsubst_pack_expansion anymore.
gcc/testsuite/
* g++.dg/cpp0x/variadic139.C: New test.
* g++.dg/cpp0x/variadic140.C: Likewise.
* g++.dg/cpp0x/variadic141.C: Likewise.
From-SVN: r195367
* gcc-interface/trans.c (Pragma_to_gnu) <Name_Space>: Use optimize_size
instead of optimize and adjust warning message.
(Compilation_Unit_to_gnu): Process pragmas preceding the unit.
From-SVN: r195366
* gcc-interface/gigi.h (ADT_unhandled_except_decl,
ADT_unhandled_others_decl): New.
(unhandled_others_decl, unhandled_except_decl): Define.
* gcc-interface/trans.c: Include common/common-target.h.
(gigi): Initialize them.
(Subprogram_Body_to_gnu): On SEH targets, wrap the body of the main
function in a try/catch clause.
From-SVN: r195364
PR tree-optimization/56051
* fold-const.c (fold_binary_loc): Don't fold
X < (cast) (1 << Y) into (X >> Y) != 0 if cast is either
a narrowing conversion, or widening conversion from signed
to unsigned.
* gcc.c-torture/execute/pr56051.c: New test.
From-SVN: r195343
PR rtl-optimization/56023
* haifa-sched.c (fix_inter_tick): Do not update ticks of instructions,
dependent on debug instruction.
testsuite/ChangeLog:
PR rtl-optimization/56023
* gcc.dg/pr56023.c: New test.
From-SVN: r195342
2013-01-21 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/56058
* config/arm/marvell-pj4.md: Update copyright year.
Fix up use of alu to alu_reg and simple_alu_imm.
From-SVN: r195332
Add support for Marvell's PJ4 CPU
2013-01-18 Yi-Hsiu Hsu <ahsu@marvell.com>
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* config/arm/marvell-pj4.md: New file.
From-SVN: r195325
2013-01-20 Vladimir Makarov <vmakarov@redhat.com>
PR target/55433
* lra-constraints.c (curr_insn_transform): Don't reuse original
insn for secondary memory move when memory mode should be
different.
From-SVN: r195322
The underlying compiler supports additional __ATOMIC_HLE_ACQUIRE/RELEASE
memmodel flags for TSX, but this was not exposed to the C++ wrapper.
Handle it there.
These are additional flags, so some of assert checks need to mask
off the flags before checking the memory model type.
libstdc++-v3/:
2013-01-12 Andi Kleen <ak@linux.intel.com>
Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/55223
* include/bits/atomic_base.h (__memory_order_modifier): Add
__memory_order_mask, __memory_order_modifier_mask,
__memory_order_hle_acquire, __memory_order_hle_release.
(operator|,operator&): Add.
(__cmpexch_failure_order): Rename to __cmpexch_failure_order2.
(__cmpexch_failure_order): Add.
(clear, store, load, compare_exchange_weak, compare_exchange_strong):
Handle flags.
* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
Add.
Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>
From-SVN: r195321
PR tree-optimization/52631
* tree-ssa-sccvn (visit_use): Before looking up the original
statement, try looking up the simplified expression.
PR tree-optimization/52631
* tree-ssa/pr52631.c: New test.
* tree-ssa/ssa-fre-9: Update expected output.
From-SVN: r195318
PR target/54908
c-family/
* c.opt (-fextern-tls-init): New.
* c-opts.c (c_common_post_options): Handle it.
cp/
* decl2.c (get_local_tls_init_fn): New.
(get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
with aliases for internal variables. Don't use weakrefs if
the variable needs destruction.
(generate_tls_wrapper): Mark the wrapper as const if no
initialization is needed.
(handle_tls_init): Don't require aliases.
From-SVN: r195310
PR tree-optimization/56029
* tree-phinodes.c (reserve_phi_args_for_new_edge): Set
gimple_phi_arg_location for the new arg to UNKNOWN_LOCATION.
* g++.dg/torture/pr56029.C: New test.
From-SVN: r195304
2013-01-18 Vladimir Makarov <vmakarov@redhat.com>
PR target/55433
* lra-constraints.c (curr_insn_transform): Reuse original insn for
secondary memory move.
(inherit_reload_reg): Use rclass instead of cl for
check_secondary_memory_needed_p.
2013-01-18 Vladimir Makarov <vmakarov@redhat.com>
PR target/55433
* gcc.target/i386/pr55433.c: New.
From-SVN: r195302
PR middle-end/56015
* expr.c (expand_expr_real_2) <case COMPLEX_EXPR>: Handle
the case where writing real complex part of target modifies
op1.
* gfortran.dg/pr56015.f90: New test.
From-SVN: r195301
PR debug/54114
PR debug/54402
PR debug/49888
* var-tracking.c (negative_power_of_two_p): New.
(global_get_addr_cache, local_get_addr_cache): New.
(get_addr_from_global_cache, get_addr_from_local_cache): New.
(vt_canonicalize_addr): Rewrite using the above. Adjust the
heading comment.
(vt_stack_offset_p): Remove.
(vt_canon_true_dep): Always canonicalize loc's address.
(clobber_overlapping_mems): Make sure we have a MEM.
(local_get_addr_clear_given_value): New.
(val_reset): Clear local cached entries.
(compute_bb_dataflow): Create and release the local cache.
Disable duplicate MEMs clobbering.
(emit_notes_in_bb): Clobber MEMs likewise.
(vt_emit_notes): Create and release the local cache.
(vt_initialize, vt_finalize): Create and release the global
cache, respectively.
* alias.c (rtx_equal_for_memref_p): Compare operands of
ENTRY_VALUEs.
From-SVN: r195291
PR rtl-optimization/55547
PR rtl-optimization/53827
PR debug/53671
PR debug/49888
* alias.c (offset_overlap_p): New, factored out of...
(memrefs_conflict_p): ... this. Use absolute sizes. Retain
the conservative special case for symbolic constants. Don't
adjust zero sizes on alignment.
From-SVN: r195289