PR rtl-optimization/pr55829
* lra-constraints.c (match_reload): Add code for absent output.
(curr_insn_transform): Add code for reloads of matched inputs
without output.
Jan Hubicka [Wed, 9 Jan 2013 15:10:43 +0000 (16:10 +0100)]
re PR tree-optimization/55875 (IVopts caused miscompilation)
PR tree-optimiation/55875
* gcc.c-torture/execute/pr55875.c: New testcase.
* g++.dg/torture/pr55875.C: New testcase.
* tree-ssa-loop-niter.c (number_of_iterations_cond): Add
EVERY_ITERATION parameter.
(number_of_iterations_exit): Check if exit is executed every
iteration.
(idx_infer_loop_bounds): Similarly here.
(n_of_executions_at_most): Simplify
to only test for cases where statement is dominated by the
particular bound; handle correctly the "postdominance"
test.
(scev_probably_wraps_p): Use max loop iterations info
as a global bound first.
Nguyen Duy Dat [Wed, 9 Jan 2013 15:07:08 +0000 (15:07 +0000)]
v850.md (cbranchsf4): New pattern.
* config/v850/v850.md (cbranchsf4): New pattern.
(cstoresf4): New pattern.
(cbranchdf4): New pattern.
(cstoredf4): New pattern.
(movsicc): Disallow floating point comparisons.
(cmpsf_le_insn): Fix order of operators.
(cmpsf_lt_insn): Likewise.
(cmpsf_eq_insn): Likewise.
(cmpdf_le_insn): Likewise.
(cmpdf_lt_insn): Likewise.
(cmpdf_eq_insn): Likewise.
(cmpsf_ge_insn): Use LE comparison.
(cmpdf_ge_insn): Likewise.
(cmpsf_gt_insn): Use LT comparison.
(cmpdf_gt_insn): Likewise.
(cmpsf_ne_insn): Delete pattern.
(cmpdf_ne_insn): Delete pattern.
* config/v850/v850.c (v850_gen_float_compare): Use
gen_cmpdf_eq_insn for NE comparison.
(v850_float_z_comparison_operator)
(v850_float_nz_comparison_operator): Move from here ...
* config/v850/predicates.md: ... to here. Move GT and GE
comparisons into v850_float_z_comparison_operator.
* config/v850/v850-protos.h (v850_float_z_comparison_operator):
Delete prototype.
(v850_float_nz_comparison_operator): Likewise.
Jakub Jelinek [Wed, 9 Jan 2013 14:51:09 +0000 (15:51 +0100)]
re PR c/48418 (Bit shift operator >>=)
PR c/48418
* c-common.c (c_fully_fold_internal): Warn for LSHIFT_EXPR and
RSHIFT_EXPR, if orig_op1 isn't INTEGER_CST, op1 is INTEGER_CST
and is either negative or bigger or equal to type precision
of the first operand.
* typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
call maybe_constant_value for the negative or too big shift
count warnings.
* config/pa/pa.h (VAL_U6_BITS_P): Define.
(INT_U6_BITS): Likewise.
* config/pa/predicates.md (uint6_operand): New predicate.
(shift5_operand, shift6_operand): Likewise.
* config/pa/pa.md (lshrsi3, rotrsi3): Use shift5_operand instead of
arith32_operand.
(lshrdi3): Use shift6_operand.
(shrpsi4, shrpdi4): New insn patterns.
(extzv): Delete expander.
(extzvsi, extzvdi): New expanders. Use uint5_operand and uint6_operand
predicates in unamed zero extract patterns. Tighten common constraint.
(extv): Delete expander.
(extvsi, extvdi): New expanders. Use uint5_operand and uint6_operand
predicates in unamed sign extract patterns. Tighten common constraint.
(insv): Delete expander.
(insvsi, insvdi): New expanders. Use uint5_operand and uint6_operand
predicates in unamed insert patterns. Tighten common constraint.
Change uint32_operand predicate to uint6_operand predicate in unamed
DImode pattern to insert constant values of type 1...1xxxx.
Jakub Jelinek [Tue, 8 Jan 2013 18:00:10 +0000 (19:00 +0100)]
re PR rtl-optimization/55845 (454.calculix miscompares with -march=btver2 -O3 -ffastmath -fschedule-insns -mvzeroupper for test data run)
PR rtl-optimization/55845
* df-problems.c (can_move_insns_across): Stop scanning at
volatile_insn_p source instruction or give up if
across_from .. across_to range contains any volatile_insn_p
instructions.
Tejas Belagod [Tue, 8 Jan 2013 16:21:51 +0000 (16:21 +0000)]
aarch64-simd.md (aarch64_simd_vec_<su>mult_lo_<mode>, [...]): Separate instruction and operand with tab instead of space.
2013-01-08 Tejas Belagod <tejas.belagod@arm.com>
* config/aarch64/aarch64-simd.md (aarch64_simd_vec_<su>mult_lo_<mode>,
aarch64_simd_vec_<su>mult_hi_<mode>): Separate instruction and operand
with tab instead of space.
Jakub Jelinek [Tue, 8 Jan 2013 08:33:43 +0000 (09:33 +0100)]
re PR middle-end/54120 (FAIL: gfortran.fortran-torture/execute/random_2.f90 execution)
PR tree-optimization/54120
* tree-vrp.c (range_fits_type_p): Don't allow
src_precision < precision from signed vr to unsigned_p
if vr->min or vr->max is negative.
(simplify_float_conversion_using_ranges): Test can_float_p
against CODE_FOR_nothing.
Paul Thomas [Tue, 8 Jan 2013 06:13:52 +0000 (06:13 +0000)]
re PR fortran/55618 (Failures with ISO_Varying_String test suite)
2013-01-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55618
* trans-expr.c (gfc_conv_procedure_call): Dereference scalar
character function arguments to elemental procedures in
scalarization loops.
2013-01-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55618
* gfortran.dg/elemental_scalar_args_2.f90: New test.
re PR target/55897 ([avr] Allocate __memx data to .progmemx.data)
PR target/55897
* config/avr/avr.h (ADDR_SPACE_COUNT): New enum.
(avr_addrspace_t): Add .section_name field.
* config/avr/avr.c (progmem_section): Use ADDR_SPACE_COUNT as
array size.
(avr_addrspace): Same. Initialize .section_name. Remove last
NULL entry. Put __memx into .progmemx.data.
(progmem_section_prefix): Remove.
(avr_asm_init_sections): No need to initialize progmem_section.
(avr_asm_named_section): Use avr_addrspace[].section_name to get
section name prefix.
(avr_asm_select_section): Ditto. And use get_unnamed_section to
retrieve the progmem section.
* avr-c.c (avr_cpu_cpp_builtins): Use ADDR_SPACE_COUNT as loop
boundary to run over avr_addrspace[].
(avr_register_target_pragmas): Ditto.
Jason Merrill [Mon, 7 Jan 2013 18:00:18 +0000 (13:00 -0500)]
re PR c++/55753 ([C++11][4.7/4.8 Regression] ICE constexpr ctor, tsubst_copy_and_build, at cp/pt.c:14336)
PR c++/55753
* tree.c (build_aggr_init_expr): Do nothing in a template.
* pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
a FUNCTION_DECL before tsubsting.
Jakub Jelinek [Mon, 7 Jan 2013 17:46:30 +0000 (18:46 +0100)]
varasm.c (output_constant_def_contents): For asan_protect_global protected strings...
* varasm.c (output_constant_def_contents): For asan_protect_global
protected strings, adjust DECL_ALIGN if needed, before testing for
anchored symbols.
(place_block_symbol): Adjust size for asan protected STRING_CSTs if
TREE_CONSTANT_POOL_ADDRESS_P. Increase alignment for asan protected
normal decls.
(output_object_block): For asan protected decls, emit asan padding
after their contents.
* asan.c (asan_protect_global): Don't check TREE_ASM_WRITTEN here.
(asan_finish_file): Test it here instead.
Richard Biener [Mon, 7 Jan 2013 14:06:26 +0000 (14:06 +0000)]
re PR tree-optimization/55888 (ICE in bitmap_set_replace_value, at tree-ssa-pre.c:867)
2013-01-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/55888
PR tree-optimization/55862
* tree-ssa-pre.c (phi_translate_1): Revert previous change.
(valid_in_sets): Check if a NAME has a leader in AVAIL_OUT,
not if it is contained therein.
Eric Botcazou [Mon, 7 Jan 2013 10:39:45 +0000 (10:39 +0000)]
decl.c (gnat_to_gnu_entity): Adjust comment about type extension with discriminants.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Adjust
comment about type extension with discriminants.
<E_Record_Subtype>: Remove useless test and reorder conditions.
(elaborate_entity) <E_Record_Subtype>: Likewise.
Dodji Seketeli [Mon, 7 Jan 2013 08:06:46 +0000 (09:06 +0100)]
PR c++/55311 - Cannot specialize alias template with arg of type array of char
Consider this test case:
1 template <const char *const C, typename T>
2 struct A
3 {};
4
5 struct B {};
6
7 extern constexpr char HELLO_WORLD[] = "hello world";
8
9 A<HELLO_WORLD, B> g; // <-- This works fine
10
11 template <typename T>
12 using PartiallySpecialized = A<HELLO_WORLD, T>; // <-- This fails
13
At line 12 G++ fails to instantiate the alias template that has a
string variable initialized with a string literal, with the error
message:
test.cc:12:46: error: ‘"hello world"’ is not a valid template argument of type ‘const char*’ because ‘"hello world"’ is not a variable
using PartiallySpecialized = A<HELLO_WORLD, T>; // <-- This fails
^
Note that instantiating the template A at line 9 with the same
arguments as in the problematic case above works.
This happens in the context of lookup_template_class_1, when it handles
the alias template instantiation A<HELLO_WORLD, T> and thus passes the
VAR_DECL for HELLO_WORLD to convert_nontype_argument.
Note that from there decay_conversion replaces the the VAR_DECL with
its STRING_CST initializer[1]. Latter on, convert_nontype_argument
checks that the HELLO_WORLD constant it received as argument was
indeed a VAR_DECL:
else
{
tree decl;
decl = ((TREE_CODE (expr) == ADDR_EXPR)
? TREE_OPERAND (expr, 0) : expr);
if (TREE_CODE (decl) != VAR_DECL)
{
error ("%qE is not a valid template argument of type %qT "
"because %qE is not a variable",
expr, type, decl);
return NULL_TREE;
}
But the issue is, that VAR_DECL has been replaced by STRING_CST, so
the last 'if' above fails.
The fix is to teach decay_conversion to return the address of array,
rather than returning its initializer.
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
gcc/cp/
PR c++/55311
* pt.c (decay_conversion): Do not return the initializer of an array.
gcc/testsuite/
PR c++/55311
* g++.dg/cpp0x/alias-decl-30.C: New test.
* g++.dg/init/array21.C: New test.
Dodji Seketeli [Mon, 7 Jan 2013 08:03:33 +0000 (08:03 +0000)]
PR c++/52343 - error with alias template as template template argument
In the example accompanying this patch, check_instantiated_arg tries
to ensure that a non-type template argument should be a constant if it
has integral or enumeration type.
The problem is that an alias template which type-id is, e.g, an
integer, looks like an argument that has integral/enumeration type:
its TREE_TYPE is an integer type. So check_instantiated_arg
mistenkaly barks that this integral non-type argument is not a
constant.
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
gcc/cp/
PR c++/52343
* pt.c (check_instantiated_arg): Allow type template arguments.
gcc/testsuite/
PR c++/52343
* g++.dg/cpp0x/alias-decl-29.C: New test.
PR fortran/PR53876
PR fortran/PR54990
PR fortran/PR54992
* trans-array.c (build_array_ref): Check the TYPE_CANONICAL
to see if it is GFC_CLASS_TYPE_P.
* trans-expr.c (gfc_get_vptr_from_expr): The same.
(gfc_conv_class_to_class): If the types are not the same,
cast parmese->expr to the type of ctree.
* trans-types.c (gfc_get_derived_type): GFC_CLASS_TYPE_P of
CLASS components must be set.
2013-01-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/PR53876
PR fortran/PR54990
PR fortran/PR54992
* gfortran.dg/class_array_15.f03: New test.
Mikael Morin [Sun, 6 Jan 2013 15:50:09 +0000 (15:50 +0000)]
re PR fortran/42769 ([OOP] ICE in resolve_typebound_procedure)
PR fortran/42769
PR fortran/45836
PR fortran/45900
* module.c (read_module): Don't reuse local symtree if the associated
symbol isn't exactly the one wanted. Don't reuse local symtree if it is
ambiguous.
* resolve.c (resolve_call): Use symtree's name instead of symbol's to
lookup the symtree.
PR fortran/42769
PR fortran/45836
PR fortran/45900
* gfortran.dg/use_23.f90: New test.
* gfortran.dg/use_24.f90: New test.
* gfortran.dg/use_25.f90: New test.
* gfortran.dg/use_26.f90: New test.
* gfortran.dg/use_27.f90: New test.
Olivier Hainque [Sun, 6 Jan 2013 12:28:58 +0000 (12:28 +0000)]
decl.c (gnat_to_gnu_field): Emit a specialized diagnostic for component size mismatch wrt volatile requirements.
* gcc-interface/decl.c (gnat_to_gnu_field): Emit a specialized
diagnostic for component size mismatch wrt volatile requirements.
Add a gcc_unreachable() at the end of the checks for size. Split
the check on volatile for positions into one check on atomic and
a subsequent one on volatile.
Steven G. Kargl [Sat, 5 Jan 2013 13:20:08 +0000 (13:20 +0000)]
re PR fortran/55827 (ICE with multiple fortran modules and character lenght determined by an interfaced pure function)
2013-01-05 Steven G. Kargl <kargl@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
PR fortran/55827
* class.c (gfc_fix_class_refs): Adapt ts initialization for the case
e->symtree == NULL.
* trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it.
2013-01-05 Steven G. Kargl <kargl@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
PR fortran/55827
* gfortran.dg/use_22.f90: New test.
Co-Authored-By: Mikael Morin <mikael@gcc.gnu.org>
From-SVN: r194928
Tobias Burnus [Sat, 5 Jan 2013 09:11:19 +0000 (10:11 +0100)]
class.c (finalize_component): Used passed offset expr.
2013-01-05 Tobias Burnus <burnus@net-b.de>
* class.c (finalize_component): Used passed offset expr.
(finalization_get_offset): New static function.
(finalizer_insert_packed_call, generate_finalization_wrapper):
Use it to handle noncontiguous arrays.
Tobias Burnus [Fri, 4 Jan 2013 21:51:34 +0000 (22:51 +0100)]
intrinsic.c (add_functions): New internal intrinsic function GFC_PREFIX ("stride").
2013-01-04 Tobias Burnus <burnus@net-b.de>
* intrinsic.c (add_functions): New internal intrinsic
function GFC_PREFIX ("stride").
* gfortran.h (gfc_isym_id): Add GFC_ISYM_STRIDE.
* intrinsic.h (gfc_resolve_stride): New prototypes.
* iresolve.c (gfc_resolve_stride): New function.
* trans-intrinsic.c (conv_intrinsic_stride): New static
function.
(gfc_conv_intrinsic_function): Use it.
Paul Thomas [Fri, 4 Jan 2013 20:50:15 +0000 (20:50 +0000)]
re PR fortran/55172 ([OOP] gfc_variable_attr(): Bad array reference in SELECT TYPE)
2013-01-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55172
* match.c (copy_ts_from_selector_to_associate): Remove call to
gfc_resolve_expr and replace it with explicit setting of the
array reference type.
* resolve.c (resolve_select_type): It is an error if the
selector is coindexed.
2013-01-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55172
* gfortran.dg/select_type_31.f03: New test.