]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
7 years agobackport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading...
Jakub Jelinek [Fri, 22 Jun 2018 21:08:47 +0000 (23:08 +0200)] 
backport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading zeroed vector member)

Backported from mainline
2018-04-07  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/85257
* fold-const.c (native_encode_vector): If not all elts could fit
and off is -1, return 0 rather than offset.
* tree-ssa-sccvn.c (vn_reference_lookup_3): Pass
(offset - offset2) / BITS_PER_UNIT as 4th argument to
native_encode_expr.  Verify len * BITS_PER_UNIT >= maxsizei.  Don't
adjust buffer in native_interpret_expr call.

* gcc.dg/pr85257.c: New test.

From-SVN: r261951

7 years agobackport: re PR debug/85252 (ICE with -g for static zero-length array initialization)
Jakub Jelinek [Fri, 22 Jun 2018 21:08:00 +0000 (23:08 +0200)] 
backport: re PR debug/85252 (ICE with -g for static zero-length array initialization)

Backported from mainline
2018-04-06  Jakub Jelinek  <jakub@redhat.com>

PR debug/85252
* dwarf2out.c (rtl_for_decl_init): For STRING_CST initializer only
build CONST_STRING if TYPE_MAX_VALUE is non-NULL and is INTEGER_CST.

* gcc.dg/debug/pr85252.c: New test.

From-SVN: r261950

7 years agobackport: re PR c++/85210 (ICE with broken structured binding in template)
Jakub Jelinek [Fri, 22 Jun 2018 21:07:16 +0000 (23:07 +0200)] 
backport: re PR c++/85210 (ICE with broken structured binding in template)

Backported from mainline
2018-04-06  Jakub Jelinek  <jakub@redhat.com>

PR c++/85210
* pt.c (tsubst_decomp_names): Return error_mark_node and assert
errorcount is set if tsubst doesn't return a VAR_DECL.

* g++.dg/cpp1z/decomp42.C: New test.

From-SVN: r261949

7 years agobackport: re PR c++/85208 (ICE with #pragma weak and structured binding)
Jakub Jelinek [Fri, 22 Jun 2018 21:06:41 +0000 (23:06 +0200)] 
backport: re PR c++/85208 (ICE with #pragma weak and structured binding)

Backported from mainline
2018-04-05  Jakub Jelinek  <jakub@redhat.com>

PR c++/85208
* decl.c (start_decl): For DECL_DECOMPOSITION_P decls, don't call
maybe_apply_pragma_weak here...
(cp_maybe_mangle_decomp): ... but call it here instead.

* g++.dg/cpp1z/decomp41.C: New test.

From-SVN: r261948

7 years agobackport: re PR inline-asm/85172 (internal compiler error: unexpected expression...
Jakub Jelinek [Fri, 22 Jun 2018 21:05:52 +0000 (23:05 +0200)] 
backport: re PR inline-asm/85172 (internal compiler error: unexpected expression '<statement>' of kind asm_expr)

Backported from mainline
2018-04-04  Jakub Jelinek  <jakub@redhat.com>

PR inline-asm/85172
* constexpr.c (cxx_eval_builtin_function_call): For calls to
builtin_valid_in_constant_expr_p functions, don't call
cxx_eval_constant_expression if argument is not
potential_constant_expression.

* g++.dg/ext/builtin13.C: New test.
* g++.dg/ext/atomic-4.C: New test.

From-SVN: r261947

7 years agobackport: re PR rtl-optimization/85167 (shrink-wrap.c:333:15: runtime error with...
Jakub Jelinek [Fri, 22 Jun 2018 21:05:08 +0000 (23:05 +0200)] 
backport: re PR rtl-optimization/85167 (shrink-wrap.c:333:15: runtime error with UBSAN)

Backported from mainline
2018-04-03  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/85167
* shrink-wrap.c (move_insn_for_shrink_wrap): Don't set bb_uses and
bb_defs if *split_p, instead preinitialize it to NULL.

* gcc.dg/pr85167.c: New test.

From-SVN: r261946

7 years agobackport: re PR c++/85147 (ICE with invalid variadic template-template parameter)
Jakub Jelinek [Fri, 22 Jun 2018 21:04:25 +0000 (23:04 +0200)] 
backport: re PR c++/85147 (ICE with invalid variadic template-template parameter)

Backported from mainline
2018-04-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/85147
* pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node.

* g++.dg/cpp0x/pr85147.C: New test.

From-SVN: r261945

7 years agobackport: re PR c++/85140 (ICE with invalid use of alignas)
Jakub Jelinek [Fri, 22 Jun 2018 21:03:38 +0000 (23:03 +0200)] 
backport: re PR c++/85140 (ICE with invalid use of alignas)

Backported from mainline
2018-04-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/85140
* name-lookup.c (handle_namespace_attrs): Return early if attributes
is error_mark_node.

* g++.dg/cpp0x/gen-attrs-64.C: New test.

From-SVN: r261944

7 years agobackport: re PR c++/84791 (ICE with broken OpenMP reduction clause)
Jakub Jelinek [Fri, 22 Jun 2018 21:02:52 +0000 (23:02 +0200)] 
backport: re PR c++/84791 (ICE with broken OpenMP reduction clause)

Backported from mainline
2018-03-30  Jakub Jelinek  <jakub@redhat.com>

PR c++/84791
* semantics.c (finish_omp_reduction_clause): If
OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true
even if processing_template_decl.

* g++.dg/gomp/pr84791.C: New test.

From-SVN: r261943

7 years agobackport: re PR target/85095 (worse code generated)
Jakub Jelinek [Fri, 22 Jun 2018 21:02:07 +0000 (23:02 +0200)] 
backport: re PR target/85095 (worse code generated)

Backported from mainline
2018-03-28  Jakub Jelinek  <jakub@redhat.com>

PR target/85095
* config/i386/i386.md (*add<mode>3_carry_0, *addsi3_carry_zext_0,
*sub<mode>3_carry_0, *subsi3_carry_zext_0): New patterns.

* gcc.target/i386/pr85095-1.c: New test.
* gcc.target/i386/pr85095-2.c: New test.
* gcc.c-torture/execute/pr85095.c: New test.

From-SVN: r261942

7 years agobackport: re PR c++/85076 (ICE with invalid template used as lambda argument)
Jakub Jelinek [Fri, 22 Jun 2018 21:01:00 +0000 (23:01 +0200)] 
backport: re PR c++/85076 (ICE with invalid template used as lambda argument)

Backported from mainline
2018-03-27  Jakub Jelinek  <jakub@redhat.com>

PR c++/85076
* tree.c (cp_build_reference_type): If to_type is error_mark_node,
return it right away.

* g++.dg/cpp1y/pr85076.C: New test.

From-SVN: r261941

7 years agobackport: re PR c++/85068 (ICE with invalid covariant return type hierarchy)
Jakub Jelinek [Fri, 22 Jun 2018 20:59:31 +0000 (22:59 +0200)] 
backport: re PR c++/85068 (ICE with invalid covariant return type hierarchy)

Backported from mainline
2018-03-27  Jakub Jelinek  <jakub@redhat.com>

PR c++/85068
* class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo
is NULL.  Assert if thunk_binfo is NULL then errorcount is non-zero.

* g++.dg/inherit/covariant22.C: New test.

From-SVN: r261940

7 years agobackport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p...
Jakub Jelinek [Fri, 22 Jun 2018 20:58:44 +0000 (22:58 +0200)] 
backport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias.c:3003)

Backported from mainline
2018-03-23  Jakub Jelinek  <jakub@redhat.com>

PR inline-asm/85022
* emit-rtl.c (init_emit_regs): Indicate that VOIDmode MEMs don't have
known size by default.

From-SVN: r261939

7 years agobackport: re PR inline-asm/85034 (-O1 internal compiler error: in elimination_costs_i...
Jakub Jelinek [Fri, 22 Jun 2018 20:58:02 +0000 (22:58 +0200)] 
backport: re PR inline-asm/85034 (-O1 internal compiler error: in elimination_costs_in_insn, at reload1.c:3633)

Backported from mainline
2018-03-23  Jakub Jelinek  <jakub@redhat.com>

PR inline-asm/85034
* function.c (match_asm_constraints_1): Don't optimize if input
doesn't satisfy general_operand predicate for output's mode.

* gcc.target/i386/pr85034.c: New test.

From-SVN: r261938

7 years agobackport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p...
Jakub Jelinek [Fri, 22 Jun 2018 20:57:15 +0000 (22:57 +0200)] 
backport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias.c:3003)

Backported from mainline
2018-03-23  Jakub Jelinek  <jakub@redhat.com>

PR inline-asm/85022
* alias.c (write_dependence_p): Don't require for x_canonicalized
non-VOIDmode if x has VOIDmode.

* c-c++-common/torture/pr85022.c: New test.

From-SVN: r261937

7 years agobackport: re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p...
Jakub Jelinek [Fri, 22 Jun 2018 20:56:25 +0000 (22:56 +0200)] 
backport: re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1870 (reg_overlap_mentioned_p()/match_asm_constraints_1()))

Backported from mainline
2018-03-22  Jakub Jelinek  <jakub@redhat.com>

PR inline-asm/84941
* function.c (match_asm_constraints_1): Don't do the optimization
if input isn't a REG, SUBREG, MEM or constant.

* gcc.dg/pr84941.c: New test.

From-SVN: r261936

7 years agobackport: re PR c/84999 (ICE in make_vector_type, at tree.c:9561)
Jakub Jelinek [Fri, 22 Jun 2018 20:55:40 +0000 (22:55 +0200)] 
backport: re PR c/84999 (ICE in make_vector_type, at tree.c:9561)

Backported from mainline
2018-03-21  Jakub Jelinek  <jakub@redhat.com>

PR c/84999
* c-typeck.c (build_binary_op): If c_common_type_for_size fails when
building vector comparison, diagnose it and return error_mark_node.

* c-c++-common/pr84999.c: New test.

From-SVN: r261934

7 years agobackport: re PR c++/84961 (ICE error: SSA_NAME_DEF_STMT is wrong)
Jakub Jelinek [Fri, 22 Jun 2018 20:54:44 +0000 (22:54 +0200)] 
backport: re PR c++/84961 (ICE error: SSA_NAME_DEF_STMT is wrong)

Backported from mainline
2018-03-21  Jakub Jelinek  <jakub@redhat.com>

PR c++/84961
* cp-tree.h (genericize_compound_lvalue): Declare.
* typeck.c (genericize_compound_lvalue): New function.
(unary_complex_lvalue, cp_build_modify_expr): Use it.
* semantics.c (finish_asm_stmt): Replace MODIFY_EXPR, PREINCREMENT_EXPR
and PREDECREMENT_EXPR in output and "m" constrained input operands with
COMPOUND_EXPR.  Call cxx_mark_addressable on the rightmost
COMPOUND_EXPR operand.

* c-c++-common/pr43690.c: Don't expect errors on "m" (--x) and
"m" (++x) in C++.
* g++.dg/torture/pr84961-1.C: New test.
* g++.dg/torture/pr84961-2.C: New test.

From-SVN: r261933

7 years agobackport: re PR debug/84875 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348...
Jakub Jelinek [Fri, 22 Jun 2018 20:53:41 +0000 (22:53 +0200)] 
backport: re PR debug/84875 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348 on s390x)

Backported from mainline
2018-03-20  Jakub Jelinek  <jakub@redhat.com>

PR debug/84875
* dce.c (delete_unmarked_insns): Don't remove frame related noop moves
holding REG_CFA_RESTORE notes, instead turn them into a USE.

* gcc.dg/pr84875.c: New test.

From-SVN: r261932

7 years agobackport: re PR c/84953 (misleading warning from strpbrk(x,""))
Jakub Jelinek [Fri, 22 Jun 2018 20:52:44 +0000 (22:52 +0200)] 
backport: re PR c/84953 (misleading warning from strpbrk(x,""))

Backported from mainline
2018-03-20  Jakub Jelinek  <jakub@redhat.com>

PR c/84953
* builtins.c (fold_builtin_strpbrk): For strpbrk(x, "") use type
instead of TREE_TYPE (s1) for the return value.

* gcc.dg/pr84953.c: New test.

From-SVN: r261931

7 years agobackport: re PR sanitizer/85018 (Many sanitizer tests ICE since r258681)
Jakub Jelinek [Fri, 22 Jun 2018 20:51:42 +0000 (22:51 +0200)] 
backport: re PR sanitizer/85018 (Many sanitizer tests ICE since r258681)

Backported from mainline
2018-03-22  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/85018
* dwarf2asm.c (dw2_output_indirect_constant_1): Set
DECL_INITIAL (decl) to decl at the end.
* varasm.c (use_blocks_for_decl_p): Revert the 2018-03-20 change,
adjust the comment.

2018-03-20  Jakub Jelinek  <jakub@redhat.com>

PR target/84990
* dwarf2asm.c (dw2_output_indirect_constant_1): Temporarily turn off
flag_section_anchors.
* varasm.c (use_blocks_for_decl_p): Remove hack for
dw2_force_const_mem.

2018-03-19  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/78651
* dwarf2asm.c: Include fold-const.c.
(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
of decl rather than decl itself.

2018-03-19  Maxim Ostapenko  <m.ostapenko@samsung.com>

PR sanitizer/78651
* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
calling assemble_variable.

* g++.dg/asan/pr78651.C: New test.

From-SVN: r261930

7 years agobackport: re PR target/84899 (ICE: in final_scan_insn_1, at final.c:3139 (error:...
Jakub Jelinek [Fri, 22 Jun 2018 20:48:57 +0000 (22:48 +0200)] 
backport: re PR target/84899 (ICE: in final_scan_insn_1, at final.c:3139 (error: could not split insn))

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

PR target/84899
* postreload.c (reload_combine_recognize_pattern): Perform
INTVAL addition in unsigned HOST_WIDE_INT type to avoid UB and
truncate_int_for_mode the result for the destination's mode.

* gcc.dg/pr84899.c: New test.

From-SVN: r261929

7 years agobackport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp...
Jakub Jelinek [Fri, 22 Jun 2018 20:47:57 +0000 (22:47 +0200)] 
backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp/decl.c:5800)

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

PR c++/84874
* g++.dg/cpp1z/desig8.C: New test.

From-SVN: r261928

7 years agobackport: re PR tree-optimization/84841 (ICE: tree check: expected ssa_name, have...
Jakub Jelinek [Fri, 22 Jun 2018 20:46:37 +0000 (22:46 +0200)] 
backport: re PR tree-optimization/84841 (ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624)

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/84841
* tree-ssa-reassoc.c (INTEGER_CONST_TYPE): Change to 1 << 4 from
1 << 3.
(FLOAT_ONE_CONST_TYPE): Define.
(constant_type): Return FLOAT_ONE_CONST_TYPE for -1.0 and 1.0.
(sort_by_operand_rank): Put entries with higher constant_type last
rather than first to match comments.

* gcc.dg/pr84841.c: New test.

From-SVN: r261927

7 years agobackport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp...
Jakub Jelinek [Fri, 22 Jun 2018 20:44:39 +0000 (22:44 +0200)] 
backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp/decl.c:5800)

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

PR c++/84874
* decl.c (reshape_init_class): Don't assert d->cur->index == field
if d->cur->index is a FIELD_DECL, instead set field to d->cur->index.

* g++.dg/cpp1z/desig7.C: New test.

From-SVN: r261926

7 years agobackport: re PR c++/79085 (ICE with placement new to unaligned location)
Jakub Jelinek [Fri, 22 Jun 2018 20:43:53 +0000 (22:43 +0200)] 
backport: re PR c++/79085 (ICE with placement new to unaligned location)

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

PR c++/79085
* calls.c (expand_call): For TREE_ADDRESSABLE rettype ignore alignment
check and use address of target always.

* g++.dg/opt/pr79085.C: New test.

From-SVN: r261925

7 years agobackport: re PR c++/84222 ([[deprecated]] class complains about internal class usage)
Jakub Jelinek [Fri, 22 Jun 2018 20:43:09 +0000 (22:43 +0200)] 
backport: re PR c++/84222 ([[deprecated]] class complains about internal class usage)

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

PR c++/84222
* cp-tree.h (cp_warn_deprecated_use): Declare.
* tree.c (cp_warn_deprecated_use): New function.
* typeck2.c (build_functional_cast): Use it.
* decl.c (grokparms): Likewise.
(grokdeclarator): Likewise.  Temporarily push nested class scope
around grokparms call for out of class member definitions.

* g++.dg/warn/deprecated.C (T::member3): Change dg-warning to dg-bogus.
* g++.dg/warn/deprecated-6.C (T::member3): Likewise.
* g++.dg/warn/deprecated-13.C: New test.

From-SVN: r261924

7 years agobackport: re PR target/84860 (ICE in emit_move_insn, at expr.c:3717)
Jakub Jelinek [Fri, 22 Jun 2018 20:41:55 +0000 (22:41 +0200)] 
backport: re PR target/84860 (ICE in emit_move_insn, at expr.c:3717)

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

PR target/84860
* optabs.c (emit_conditional_move): Pass address of cmode's copy
rather than address of cmode as last argument to prepare_cmp_insn.

* gcc.c-torture/compile/pr84860.c: New test.

From-SVN: r261923

7 years agobackport: re PR c/84853 (ICE: verify_gimple failed (expand_shift_1))
Jakub Jelinek [Fri, 22 Jun 2018 20:40:45 +0000 (22:40 +0200)] 
backport: re PR c/84853 (ICE: verify_gimple failed (expand_shift_1))

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

PR c/84853
* c-typeck.c (build_binary_op) <case RSHIFT_EXPR, case LSHIFT_EXPR>:
If code1 is INTEGER_TYPE, only allow code0 VECTOR_TYPE if it has
INTEGER_TYPE element type.

* gcc.dg/pr84853.c: New test.

From-SVN: r261922

7 years agobackport: re PR middle-end/84834 (ICE: tree check: expected integer_cst, have complex...
Jakub Jelinek [Fri, 22 Jun 2018 20:38:25 +0000 (22:38 +0200)] 
backport: re PR middle-end/84834 (ICE: tree check: expected integer_cst, have complex_cst in to_wide, at tree.h:5527)

Backported from mainline
2018-03-13  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/84834
* match.pd ((A & C) != 0 ? D : 0): Use INTEGER_CST@2 instead of
integer_pow2p@2 and test integer_pow2p in condition.
(A < 0 ? C : 0): Similarly for @1.

* gcc.dg/pr84834.c: New test.

From-SVN: r261921

7 years agobackport: re PR target/84827 (ICE in extract_insn, at recog.c:2311)
Jakub Jelinek [Fri, 22 Jun 2018 20:37:40 +0000 (22:37 +0200)] 
backport: re PR target/84827 (ICE in extract_insn, at recog.c:2311)

Backported from mainline
2018-03-13  Jakub Jelinek  <jakub@redhat.com>

PR target/84827
* config/i386/i386.md (round<mode>2): For 387 fancy math, disable
pattern if -ftrapping-math -fno-fp-int-builtin-inexact.

* gcc.target/i386/pr84827.c: New test.

From-SVN: r261920

7 years agobackport: re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting...
Jakub Jelinek [Fri, 22 Jun 2018 20:36:31 +0000 (22:36 +0200)] 
backport: re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)

Backported from mainline
2018-03-13  Jakub Jelinek  <jakub@redhat.com>

PR target/84786
* config/i386/sse.md (sse2_loadhpd): Use Yv constraint rather than v
on the last operand.

* gcc.target/i386/avx512f-pr84786-1.c: New test.
* gcc.target/i386/avx512f-pr84786-2.c: New test.

From-SVN: r261919

7 years agobackport: re PR target/84772 (powerpc-spe: Spurious "is used uninitialized" warning...
Jakub Jelinek [Fri, 22 Jun 2018 20:35:29 +0000 (22:35 +0200)] 
backport: re PR target/84772 (powerpc-spe: Spurious "is used uninitialized" warning, or possibly incorrect codegen for va_arg(long double))

Backported from mainline
2018-03-09  Jakub Jelinek  <jakub@redhat.com>

PR target/84772
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Mark va_arg_tmp
temporary TREE_ADDRESSABLE before gimplification of BUILT_IN_MEMCPY.

* gcc.dg/pr84772.c: New test.

From-SVN: r261918

7 years agobackport: re PR c++/84076 (Warning about objects through POD mistakenly claims the...
Jakub Jelinek [Fri, 22 Jun 2018 20:34:33 +0000 (22:34 +0200)] 
backport: re PR c++/84076 (Warning about objects through POD mistakenly claims the object is a pointer)

Backported from mainline
2018-03-09  Jason Merrill  <jason@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

PR c++/84076
* call.c (convert_arg_to_ellipsis): Instead of cp_build_addr_expr
build ADDR_EXPR with REFERENCE_TYPE.
(build_over_call): For purposes of check_function_arguments, if
argarray[j] is ADDR_EXPR with REFERENCE_TYPE created above, use
its operand rather than the argument itself.

* g++.dg/warn/Wformat-2.C: New test.

From-SVN: r261917

7 years agobackport: re PR c++/84767 (ICE with pointer to VLA)
Jakub Jelinek [Fri, 22 Jun 2018 20:33:38 +0000 (22:33 +0200)] 
backport: re PR c++/84767 (ICE with pointer to VLA)

Backported from mainline
2018-03-09  Jakub Jelinek  <jakub@redhat.com>

PR c++/84767
* tree-inline.c (copy_tree_body_r): For INDIRECT_REF of a remapped
decl, use remap_type if we want to use the type.

* g++.dg/ext/vla18.C: New test.

From-SVN: r261916

7 years agobackport: re PR c++/80598 (-Wunused triggers for functions used in uninstantiated...
Jakub Jelinek [Fri, 22 Jun 2018 20:32:15 +0000 (22:32 +0200)] 
backport: re PR c++/80598 (-Wunused triggers for functions used in uninstantiated templates)

Backported from mainline
2018-03-08  Jason Merrill  <jason@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

PR c++/80598
* call.c (build_over_call): In templates set TREE_USED (first_fn) when
not calling mark_used for the benefit of -Wunused-function warning.

* g++.dg/warn/Wunused-function4.C: New test.

From-SVN: r261915

7 years agobackport: re PR tree-optimization/84739 (ICE in get_value_for_expr, at tree-ssa-ccp...
Jakub Jelinek [Fri, 22 Jun 2018 20:31:10 +0000 (22:31 +0200)] 
backport: re PR tree-optimization/84739 (ICE in get_value_for_expr, at tree-ssa-ccp.c:649)

Backported from mainline
2018-03-08  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/84739
* tree-tailcall.c (find_tail_calls): Check call arguments against
DECL_ARGUMENTS (current_function_decl) rather than
DECL_ARGUMENTS (func) when checking for tail recursion.

* gcc.dg/pr84739.c: New test.

From-SVN: r261914

7 years agobackport: re PR target/84700 (ICE on 32-bit BE powerpc targets w/ -misel -O1)
Jakub Jelinek [Fri, 22 Jun 2018 20:29:34 +0000 (22:29 +0200)] 
backport: re PR target/84700 (ICE on 32-bit BE powerpc targets w/ -misel -O1)

Backported from mainline
2018-03-05  Jakub Jelinek  <jakub@redhat.com>

PR target/84700
* combine.c (combine_simplify_rtx): Don't try to simplify if
if_then_else_cond returned non-NULL, but either true_rtx or false_rtx
are equal to x.

* gcc.target/powerpc/pr84700.c: New test.

From-SVN: r261913

7 years agobackport: re PR c++/84662 (internal compiler error: tree check: expected class 'type...
Jakub Jelinek [Fri, 22 Jun 2018 20:28:04 +0000 (22:28 +0200)] 
backport: re PR c++/84662 (internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in is_bitfield_expr_with_lowered_type, at cp/typeck.c:1944)

Backported from mainline
2018-03-02  Jakub Jelinek  <jakub@redhat.com>

PR c++/84662
* pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use
RETURN instead of return.
<case POINTER_PLUS_EXPR>: Likewise.
<case CONVERT_EXPR>: If op0 is error_mark_node, just return
it instead of wrapping it into CONVERT_EXPR.

* g++.dg/cpp1y/pr84662.C: New test.

From-SVN: r261912

7 years agoPR libstdc++/86138 prevent implicit instantiation of COW empty rep
Jonathan Wakely [Fri, 22 Jun 2018 15:58:38 +0000 (16:58 +0100)] 
PR libstdc++/86138 prevent implicit instantiation of COW empty rep

The explicit instantiation declarations for std::basic_string are
disabled for C++17 (and later) so that basic_string symbols get
implicitly instantiated in every translation unit that needs them.  On
targets that don't support STB_GNU_UNIQUE this leads to multiple copies
of the empty rep symbol for COW strings. In order to detect whether a
COW string needs to deallocate its storage it compares the address with
the empty rep.  When there are multiple copies of the empty rep object
the address is not unique, and so string destructors try to delete the
empty rep, which crashes.

In order to guarantee uniqueness of the _S_empty_rep_storage symbol this
patch adds an explicit instantiation declaration for just that symbol.
This means the other symbols are still implicitly instantiated in C++17
code, but for the empty rep the definition in the library gets used.

Separately, there is no need for C++17 code to implicitly instantiate
the I/O functions for strings, so this also restores the explicit
instantiation declarations for those functions.

Backport from mainline
2018-06-22  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/86138
* include/bits/basic_string.tcc:
[__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
(basic_string<char>::_Rep::_S_empty_rep_storage)
(basic_string<wchar_t>::_Rep::_S_empty_rep_storage): Add explicit
instantiation declarations.
[__cplusplus > 201402] (operator>>, operator<<, getline): Re-enable
explicit instantiation declarations.
* testsuite/21_strings/basic_string/cons/char/86138.cc: New.
* testsuite/21_strings/basic_string/cons/wchar_t/86138.cc: New.

From-SVN: r261907

7 years agobackport: arm_cmse.h (cmse_nsfptr_create): Change typeof to __typeof__.
Andre Vieira [Fri, 22 Jun 2018 14:38:34 +0000 (14:38 +0000)] 
backport: arm_cmse.h (cmse_nsfptr_create): Change typeof to __typeof__.

gcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* config/arm/arm_cmse.h (cmse_nsfptr_create): Change typeof to
__typeof__.
(cmse_check_pointed_object): Likewise.

gcc/testsuite/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* gcc.target/arm/cmse/cmse-1c99.c: New test.

From-SVN: r261900

7 years agobackport: arm_cmse.h (cmse_nsfptr_create, [...]): Remove #include <stdint.h>.
Andre Vieira [Fri, 22 Jun 2018 14:35:24 +0000 (14:35 +0000)] 
backport: arm_cmse.h (cmse_nsfptr_create, [...]): Remove #include <stdint.h>.

gcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-05-17  Jerome Lambourg  <lambourg@adacore.com>

* config/arm/arm_cmse.h (cmse_nsfptr_create, cmse_is_nsfptr): Remove
#include <stdint.h>.  Replace intptr_t with __INTPTR_TYPE__.

libgcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-05-17  Jerome Lambourg  <lambourg@adacore.com>

* config/arm/cmse.c (cmse_check_address_range): Replace
UINTPTR_MAX with __UINTPTR_MAX__ and uintptr_t with __UINTPTR_TYPE__.

From-SVN: r261898

7 years agosyscall: remove Ustat
Ian Lance Taylor [Fri, 22 Jun 2018 14:25:18 +0000 (14:25 +0000)] 
syscall: remove Ustat

    glibc 2.28 removes ustat.h and the ustat function entirely, which
    breaks syscall.Ustat.

    Updates golang/go#25990

    Reviewed-on: https://go-review.googlesource.com/120535

From-SVN: r261894

7 years agoDaily bump.
GCC Administrator [Fri, 22 Jun 2018 00:16:34 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261875

7 years ago* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
Jonathan Wakely [Thu, 21 Jun 2018 20:51:51 +0000 (21:51 +0100)] 
* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r261864

7 years agoRISC-V: Add custom RTEMS multilibs
Sebastian Huber [Thu, 21 Jun 2018 09:36:40 +0000 (09:36 +0000)] 
RISC-V: Add custom RTEMS multilibs

Add multilib variants for -march=rv64imafd, e.g. to support the BOOMv2 core.

Add -mcmodel=medany as a variant of the 64-bit multilibs for RTEMS.  The
rationale for this change is that several existing RISC-V chips map the
RAM at 0x80000000.  In RTEMS, we do not use virtual memory, so
applications will run at this location which is outside the +-2GiB range
in a 64-bit configuration.

gcc/
* config.gcc (riscv*-*-elf* | riscv*-*-rtems*): Use custom
multilibs for *-*-rtems*.
* config/riscv/t-rtems: New file.

From-SVN: r261838

7 years agoDaily bump.
GCC Administrator [Thu, 21 Jun 2018 00:16:37 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261828

7 years agoDaily bump.
GCC Administrator [Wed, 20 Jun 2018 00:16:49 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261777

7 years agoxtensa: fix PR target/65416
Max Filippov [Tue, 19 Jun 2018 21:01:22 +0000 (21:01 +0000)] 
xtensa: fix PR target/65416

The issue is caused by reordering of stack pointer update after stack
space allocation with instructions that write to the allocated stack
space. In windowed ABI register spill area for the previous call frame
is located just below the stack pointer and may be reloaded back into
the register file on movsp.
Implement allocate_stack pattern for windowed ABI configuration and
insert an instruction that prevents reordering of frame memory access
and stack pointer update.

gcc/
2018-06-19  Max Filippov  <jcmvbkbc@gmail.com>

Backport from mainline
2018-06-19  Max Filippov  <jcmvbkbc@gmail.com>

* config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec
constant.
(allocate_stack, frame_blockage, *frame_blockage): New patterns.

From-SVN: r261764

7 years agoRemove unused <exception> header from <utility>
Jonathan Wakely [Tue, 19 Jun 2018 17:32:50 +0000 (18:32 +0100)] 
Remove unused <exception> header from <utility>

This header was needed for the declaration of std::terminate but the
calls to it were removed in r242401.

* include/std/utility: Remove unused <exception> header.

From-SVN: r261752

7 years agogimplify.c (gimplify_init_constructor): Really never clear for an incomplete construc...
Eric Botcazou [Tue, 19 Jun 2018 09:46:40 +0000 (09:46 +0000)] 
gimplify.c (gimplify_init_constructor): Really never clear for an incomplete constructor if CONSTRUCTOR_NO_CLEARING is set.

* gimplify.c (gimplify_init_constructor): Really never clear for an
incomplete constructor if CONSTRUCTOR_NO_CLEARING is set.

From-SVN: r261737

7 years agoDaily bump.
GCC Administrator [Tue, 19 Jun 2018 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261722

7 years agoPR middle-end/82063 - issues with arguments enabled by -Wall
Martin Sebor [Tue, 19 Jun 2018 00:02:30 +0000 (00:02 +0000)] 
PR middle-end/82063 - issues with arguments enabled by -Wall

gcc/ChangeLog:
        PR middle-end/82063
        * calls.c (alloc_max_size): Correct a logic error/typo.
        Treat excessive arguments as infinite.  Warn for invalid arguments.
        * doc/invoke.texi (-Walloc-size-larger-than): Update.

gcc/testsuite/ChangeLog:
        PR middle-end/82063
        * gcc.dg/Walloc-size-larger-than-1.c: New test.
        * gcc.dg/Walloc-size-larger-than-10.c: New test.
        * gcc.dg/Walloc-size-larger-than-11.c: New test.
        * gcc.dg/Walloc-size-larger-than-12.c: New test.
        * gcc.dg/Walloc-size-larger-than-13.c: New test.
        * gcc.dg/Walloc-size-larger-than-14.c: New test.
        * gcc.dg/Walloc-size-larger-than-15.c: New test.
        * gcc.dg/Walloc-size-larger-than-16.c: New test.
        * gcc.dg/Walloc-size-larger-than-2.c: New test.
        * gcc.dg/Walloc-size-larger-than-3.c: New test.
        * gcc.dg/Walloc-size-larger-than-4.c: New test.
        * gcc.dg/Walloc-size-larger-than-5.c: New test.
        * gcc.dg/Walloc-size-larger-than-6.c: New test.
        * gcc.dg/Walloc-size-larger-than-7.c: New test.
        * gcc.dg/Walloc-size-larger-than-8.c: New test.
        * gcc.dg/Walloc-size-larger-than-9.c: New test.
        * gcc.dg/Walloc-size-larger-than.c: New test.

From-SVN: r261720

7 years agoDaily bump.
GCC Administrator [Mon, 18 Jun 2018 00:16:21 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261693

7 years agoDaily bump.
GCC Administrator [Sun, 17 Jun 2018 00:16:15 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261684

7 years agoDaily bump.
GCC Administrator [Sat, 16 Jun 2018 00:16:29 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261672

7 years agoPR libstdc++/86169 unshare COW string when non-const data() called
Jonathan Wakely [Fri, 15 Jun 2018 19:19:04 +0000 (20:19 +0100)] 
PR libstdc++/86169 unshare COW string when non-const data() called

PR libstdc++/86169
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
(basic_string::data()): Unshare string.
* testsuite/21_strings/basic_string/operations/data/char/86169.cc:
New.

From-SVN: r261646

7 years agoOnly define __cpp_lib_constexpr_char_traits for C++17
Jonathan Wakely [Fri, 15 Jun 2018 16:42:57 +0000 (17:42 +0100)] 
Only define __cpp_lib_constexpr_char_traits for C++17

* include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): Only
define for C++17 and above.

From-SVN: r261637

7 years agoDaily bump.
GCC Administrator [Fri, 15 Jun 2018 00:16:31 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261615

7 years agoRTEMS: Prefer int for int32_t
Sebastian Huber [Thu, 14 Jun 2018 05:19:35 +0000 (05:19 +0000)] 
RTEMS: Prefer int for int32_t

Common systems like glibc and FreeBSD define int32_t to int.  This means
a lot of third party code works well in these cases:

  #include <stdint.h>

  void f(int32_t);

  void f(int);

  void g(int32_t *);

  void h(void)
  {
    int i;
    g(&i);
  }

On RTEMS you got however in C

  test.c:5:6: error: conflicting types for 'f'
    void f(int);
        ^
  test.c:3:6: note: previous declaration of 'f' was here
    void f(int32_t);
        ^
  test.c: In function 'h':
  test.c:12:4: warning: passing argument 1 of 'g' from incompatible
  pointer type [-Wincompatible-pointer-types]
    g(&i);
      ^
  test.c:7:6: note: expected 'int32_t * {aka long int *}' but argument
  is of type 'int *' void g(int32_t *);

and C++

  test.c: In function 'void h()':
  test.c:12:4: error: invalid conversion from 'int*' to 'int32_t* {aka
  long int*}' [-fpermissive]
    g(&i);
      ^~
  test.c:7:6: note:   initializing argument 1 of 'void g(int32_t*)'
    void g(int32_t *);
      ^

This was due to a Newlib speciality which uses long for int32_t if long
is a 32-bit type.  To ease the use of third party software in RTEMS we
override this Newlib option now and use int for int32_t if int is a
32-bit type.

gcc/
* config/rtems.h (STDINT_LONG32): Define.

From-SVN: r261584

7 years agoDaily bump.
GCC Administrator [Thu, 14 Jun 2018 00:16:10 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261578

7 years agore PR fortran/86110 (ICE in gfc_resolve_character_array_constructor, at fortran/array...
Steven G. Kargl [Wed, 13 Jun 2018 22:40:46 +0000 (22:40 +0000)] 
re PR fortran/86110 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2044)

2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86110
* array.c (gfc_resolve_character_array_constructor): Avoid NULL
pointer dereference.

2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86110
* gfortran.dg/pr86110.f90: New test.

From-SVN: r261575

7 years agoDaily bump.
GCC Administrator [Wed, 13 Jun 2018 00:16:38 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261533

7 years agoPR c++/85815 - reference to member of enclosing template.
Jason Merrill [Tue, 12 Jun 2018 19:53:10 +0000 (15:53 -0400)] 
PR c++/85815 - reference to member of enclosing template.

* parser.c (cp_parser_postfix_dot_deref_expression): Check
currently_open_class.

From-SVN: r261524

7 years agoPR c++/86060 - ICE on range for with -std=c++98.
Jason Merrill [Tue, 12 Jun 2018 19:53:02 +0000 (15:53 -0400)] 
PR c++/86060 - ICE on range for with -std=c++98.

* parser.c (cp_parser_init_statement): Don't clobber *decl after
pedwarn.

From-SVN: r261523

7 years agore PR fortran/44491 (Diagnostic just shows "<During initialization>" instead of a...
Steven G. Kargl [Tue, 12 Jun 2018 18:28:25 +0000 (18:28 +0000)] 
re PR fortran/44491 (Diagnostic just shows "<During initialization>" instead of a locus)

2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/44491
* expr.c (gfc_check_assign): Select non-NULL locus.

2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/44491
* gfortran.dg/pr44491.f90: New testcase

From-SVN: r261520

7 years agoada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from using TYPE_LANG_FLAG_4 to using...
Eric Botcazou [Tue, 12 Jun 2018 10:35:05 +0000 (10:35 +0000)] 
ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.

* gcc-interface/ada-tree.h (TYPE_RETURN_BY_DIRECT_REF_P): Change from
using TYPE_LANG_FLAG_4 to using TYPE_LANG_FLAG_0.
(TYPE_ALIGN_OK): Move around.
(TYPE_PADDING_FOR_COMPONENT): Remove superfluous parentheses.
* gcc-interface/decl.c (change_qualified_type): Move to...
(gnat_to_gnu_entity): Adjust comment.
* gcc-interface/gigi.h (change_qualified_type): ...here; make inline.
(ceil_pow2): Use ceil_log2.
* gcc-interface/utils.c (finish_subprog_decl): Add couple of comments
and do not set TREE_SIDE_EFFECTS.
(handle_noreturn_attribute): Use change_qualified_type.

From-SVN: r261488

7 years agodecl.c (gnat_to_gnu_entity): Do not get the expression of a dispatch table that is...
Eric Botcazou [Tue, 12 Jun 2018 10:20:02 +0000 (10:20 +0000)] 
decl.c (gnat_to_gnu_entity): Do not get the expression of a dispatch table that is not being defined.

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Do not get
the expression of a dispatch table that is not being defined.
<E_Record_Subtype>: Remove obsolete kludge.

From-SVN: r261485

7 years agoBackpor from mainline
Eric Botcazou [Tue, 12 Jun 2018 10:09:20 +0000 (10:09 +0000)] 
Backpor from mainline
2018-06-02  Eric Botcazou  <ebotcazou@adacore.com>

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
not a definition, retrieve the expression only if it's a compile-time
known value if we are just annotating types.

* gcc-interface/utils.c (convert): Do not try to upcast properly for a
conversion between tagged types in type_annotate_only mode.

From-SVN: r261482

7 years agobackport: decl.c (gnat_to_gnu_entity): Reuse the existing fields of a dummy fat point...
Eric Botcazou [Tue, 12 Jun 2018 09:31:48 +0000 (09:31 +0000)] 
backport: decl.c (gnat_to_gnu_entity): Reuse the existing fields of a dummy fat pointer type, if any.

Backport from mainline
2018-06-11  Eric Botcazou  <ebotcazou@adacore.com>

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Reuse the
existing fields of a dummy fat pointer type, if any.  Clear the
TYPE_DECL_SUPPRESS_DEBUG on the fat pointer type after completing it.

From-SVN: r261478

7 years agoDaily bump.
GCC Administrator [Tue, 12 Jun 2018 00:16:09 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261470

7 years agobackport: re PR target/85755 (PowerPC Gcc's -mupdate produces inefficient code on...
Peter Bergner [Mon, 11 Jun 2018 18:25:37 +0000 (13:25 -0500)] 
backport: re PR target/85755 (PowerPC Gcc's -mupdate produces inefficient code on power8/power9 machines)

gcc/
Backport from mainline
2018-06-08  Peter Bergner  <bergner@vnet.ibm.com>

PR target/85755
* config/rs6000/rs6000.c (mem_operand_gpr): Enable PRE_INC and PRE_DEC
addresses.

gcc/testsuite/
Backport from mainline
2018-06-08  Peter Bergner  <bergner@vnet.ibm.com>

PR target/85755
* gcc.target/powerpc/pr85755.c: New test.

From-SVN: r261442

7 years agoDaily bump.
GCC Administrator [Mon, 11 Jun 2018 00:16:11 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261391

7 years agoAdd ChangeLog entry
Jerry DeLisle [Sun, 10 Jun 2018 03:10:09 +0000 (03:10 +0000)] 
Add ChangeLog entry

From-SVN: r261385

7 years agobackport: re PR libfortran/86070 (gfortran.dg/fmt_zero_digits.f90 segmentation fault...
Jerry DeLisle [Sun, 10 Jun 2018 03:10:00 +0000 (03:10 +0000)] 
backport: re PR libfortran/86070 (gfortran.dg/fmt_zero_digits.f90 segmentation fault starting with r261077)

2018-06-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

Backport from trunk.
PR libgfortran/86070
* io/write_float.def (build_float_string): Initialize *len.

From-SVN: r261384

7 years agoDaily bump.
GCC Administrator [Sun, 10 Jun 2018 00:17:03 +0000 (00:17 +0000)] 
Daily bump.

From-SVN: r261379

7 years agore PR fortran/38351 (Poor error message for rank mismatch in operator args)
Steven G. Kargl [Sat, 9 Jun 2018 21:54:45 +0000 (21:54 +0000)] 
re PR fortran/38351 (Poor error message for rank mismatch in operator args)

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/38351
* resolve.c (resolve_operator): Provide better error message for
derived type entity used in an binary intrinsic numeric operator.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/38351
* gfortran.dg/pr38351.f90: New test.
* gfortran.dg/typebound_operator_4.f03: Adjust for new error message.

From-SVN: r261376

7 years agore PR fortran/63514 (functions containing volatile are considered pure)
Steven G. Kargl [Sat, 9 Jun 2018 20:10:34 +0000 (20:10 +0000)] 
re PR fortran/63514 (functions containing volatile are considered pure)

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/63514
* symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/63514
* gfortran.dg/pr63514.f90: New test.

From-SVN: r261375

7 years agore PR fortran/78278 (ICE in gfc_wide_memset, at fortran/scanner.c:153)
Steven G. Kargl [Sat, 9 Jun 2018 19:57:29 +0000 (19:57 +0000)] 
re PR fortran/78278 (ICE in gfc_wide_memset, at fortran/scanner.c:153)

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/78278
* data.c (gfc_assign_data_value): Re-arrange code to allow for
an error for double initialization of CHARACTER entities.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/78278
* gfortran.dg/data_bounds_1.f90: Add -std=gnu option.
* gfortran.dg/data_char_1.f90: Ditto.
* gfortran.dg/pr78571.f90: Ditto.
* gfortran.dg/pr78278.f90: New test.

From-SVN: r261374

7 years agore PR fortran/86059 (ICE in reduce_binary_ac, at fortran/arith.c:1308 (and others))
Steven G. Kargl [Sat, 9 Jun 2018 18:54:56 +0000 (18:54 +0000)] 
re PR fortran/86059 (ICE in reduce_binary_ac, at fortran/arith.c:1308 (and others))

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86059
* array.c (match_array_cons_element): NULL() cannot be in an
array constructor.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86059
* gfortran.dg/associate_30.f90: Remove code tested ...
* gfortran.dg/pr67803.f90: Ditto.
* gfortran.dg/pr67805.f90: Ditto.
* gfortran.dg/pr86059.f90: ... here.  New test.

From-SVN: r261373

7 years agore PR fortran/85138 (ICE with generic function)
Steven G. Kargl [Sat, 9 Jun 2018 18:29:40 +0000 (18:29 +0000)] 
re PR fortran/85138 (ICE with generic function)

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85138
PR fortran/85996
PR fortran/86051
* decl.c (gfc_match_char_spec): Use private namespace in attempt to
reduce a charlen to a constant.

2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85138
PR fortran/85996
PR fortran/86051
* gfortran.dg/pr85138_1.f90: New test.
* gfortran.dg/pr85138_2.f90: Ditto.
* gfortran.dg/pr85996.f90: Ditto.

From-SVN: r261371

7 years agoDaily bump.
GCC Administrator [Sat, 9 Jun 2018 00:16:23 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261355

7 years agoDaily bump.
GCC Administrator [Fri, 8 Jun 2018 00:16:19 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261301

7 years agore PR fortran/86045 (ICE in reduce_binary_ac, at fortran/arith.c:1308)
Steven G. Kargl [Thu, 7 Jun 2018 18:39:30 +0000 (18:39 +0000)] 
re PR fortran/86045 (ICE in reduce_binary_ac, at fortran/arith.c:1308)

2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86045
Backport from trunk.
* simplify.c (gfc_simplify_mod): Re-arrange code to test whether
'P' is zero and issue an error if it is.

2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86045
Backport from trunk.
* gfortran.dg/pr86045.f90: New test.

From-SVN: r261291

7 years agore PR fortran/85641 (ICE with string concatenate)
Thomas Koenig [Thu, 7 Jun 2018 18:13:33 +0000 (18:13 +0000)] 
re PR fortran/85641 (ICE with string concatenate)

2018-06-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/85641
Backport from trunk.
* frontend-passes.c (is_fe_temp): Add prototype.
(realloc_string_callback): Early return for frontend-generated
temporary.

2018-06-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/85641
Backport from trunk.
* gfortran.dg/realloc_on_assign_30.f90: New test.

From-SVN: r261289

7 years agobackport: re PR target/63177 (Powerpc no-vfa-vect-depend-2.c and no-vfa-vect-depend...
Peter Bergner [Thu, 7 Jun 2018 14:01:57 +0000 (09:01 -0500)] 
backport: re PR target/63177 (Powerpc no-vfa-vect-depend-2.c and no-vfa-vect-depend-3.c failures)

Backport from mainline
2018-06-06  Peter Bergner  <bergner@vnet.ibm.com>

PR target/63177
* /config/rs6000/rs6000.h (ASM_CPU_SPEC): Add support for -mpower9.
Don't handle -mcpu=power8 if -mpower9-vector is also used.

From-SVN: r261276

7 years agobackport: re PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2...
Richard Biener [Thu, 7 Jun 2018 11:56:25 +0000 (11:56 +0000)] 
backport: re PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2.27 on x86)

2018-06-07  Richard Biener  <rguenther@suse.de>

Backport from mainline
2018-03-19  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/84761
* sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ):
Define if not defined.
(DL_INTERNAL_FUNCTION): Don't define.
(InitTlsSize): For __i386__ if not compiled against glibc 2.27+
determine at runtime whether to use regparm(3), stdcall calling
convention for older glibcs or normal calling convention for
newer glibcs for call to _dl_get_tls_static_info.

From-SVN: r261272

7 years agobackport: [multiple changes]
Richard Biener [Thu, 7 Jun 2018 10:10:00 +0000 (10:10 +0000)] 
backport: [multiple changes]

2018-06-07  Richard Biener  <rguenther@suse.de>

Backport from mainline
2018-05-04  Richard Biener  <rguenther@suse.de>

PR middle-end/85588
* fold-const.c (negate_expr_p): Restrict negation of operand
zero of a division to when we know that can happen without
overflow.
(fold_negate_expr_1): Likewise.

* gcc.dg/torture/pr85588.c: New testcase.
* gcc.dg/torture/pr57656.c: Use dg-additional-options.

2018-05-02  Richard Biener  <rguenther@suse.de>

PR middle-end/85567
* gimplify.c (gimplify_save_expr): When in SSA form allow
SAVE_EXPRs to compute to SSA vars.

* gcc.dg/torture/pr85567.c: New testcase.

2018-05-02  Richard Biener  <rguenther@suse.de>

PR tree-optimization/85597
* tree-vect-stmts.c (vectorizable_operation): For ternary SLP
do not use split vect_get_vec_defs call but call vect_get_slp_defs
directly.

* gcc.dg/vect/pr85597.c: New testcase.

From-SVN: r261269

7 years agoDaily bump.
GCC Administrator [Thu, 7 Jun 2018 00:16:11 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261257

7 years agoDaily bump.
GCC Administrator [Wed, 6 Jun 2018 00:16:23 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261224

7 years agoS/390: Fix __builtin_tbeginc signature
Andreas Krebbel [Tue, 5 Jun 2018 08:21:57 +0000 (08:21 +0000)] 
S/390: Fix __builtin_tbeginc signature

The builtin was accidentally defined to have an integer return value.
Fixed with the attached patch.

gcc/ChangeLog:

2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/s390-builtin-types.def: Add void function type.
* config/s390/s390-builtins.def: Use the function type for the
tbeginc builtin.

gcc/testsuite/ChangeLog:

2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2018-06-05  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/htm-builtins-compile-4.c: New test.

From-SVN: r261190

7 years agoDaily bump.
GCC Administrator [Tue, 5 Jun 2018 00:16:10 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261178

7 years agore PR fortran/85981 (ICE in gfc_trans_string_copy, at fortran/trans-expr.c:6539)
Steven G. Kargl [Mon, 4 Jun 2018 17:09:01 +0000 (17:09 +0000)] 
re PR fortran/85981 (ICE in gfc_trans_string_copy, at fortran/trans-expr.c:6539)

2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85981
* resolve.c (resolve_allocate_deallocate): Check errmsg is default
character kind.

2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85981
* gfortran.dg/allocate_alloc_opt_14.f90: New test.
* gfortran.dg/allocate_alloc_opt_1.f90: Update error string.
* gfortran.dg/allocate_stat_2.f90: Ditto.
* gfortran.dg/deallocate_alloc_opt_1.f90: Ditto.

From-SVN: r261162

7 years agoDaily bump.
GCC Administrator [Mon, 4 Jun 2018 00:16:33 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261134

7 years agoDaily bump.
GCC Administrator [Sun, 3 Jun 2018 00:16:09 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261118

7 years agoAdd missing directive
Eric Botcazou [Sat, 2 Jun 2018 10:58:13 +0000 (10:58 +0000)] 
Add missing directive

From-SVN: r261111

7 years agoada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
Eric Botcazou [Sat, 2 Jun 2018 10:52:39 +0000 (10:52 +0000)] 
ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.

* gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
* gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
type built for an aliased component with variable size.

From-SVN: r261108

7 years agobackport: trans.c (Call_to_gnu): If this is a function call and there is no target...
Eric Botcazou [Sat, 2 Jun 2018 09:52:57 +0000 (09:52 +0000)] 
backport: trans.c (Call_to_gnu): If this is a function call and there is no target...

Backport from mainline
2018-05-31  Eric Botcazou  <ebotcazou@adacore.com>

* gcc-interface/trans.c (Call_to_gnu): If this is a function call and
there is no target, also create a temporary for the return value for
an allocator if the type is an unconstrained record type with default
discriminant.

From-SVN: r261104

7 years agoDaily bump.
GCC Administrator [Sat, 2 Jun 2018 00:16:21 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261094

7 years agobackport: re PR fortran/85840 (Memory leak in write.c)
Jerry DeLisle [Fri, 1 Jun 2018 18:34:09 +0000 (18:34 +0000)] 
backport: re PR fortran/85840 (Memory leak in write.c)

2018-06-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

Backport from trunk.
PR libgfortran/85840
* io/write.c (write_float_0, write_real, write_real_g0,
write_complex): Use separate local variables for the float
string length.

From-SVN: r261077