Uros Bizjak [Fri, 21 Dec 2018 18:11:04 +0000 (19:11 +0100)]
backport: re PR target/88418 (ICE in extract_insn, at recog.c:2305 (error: unrecognizable insn))
Backport from mainline
2018-12-10 Uros Bizjak <ubizjak@gmail.com>
PR target/88418
* config/i386/i386.c (ix86_expand_sse_cmp): For vector modes,
check operand 1 with vector_operand predicate.
(ix86_expand_sse_movcc): For vector modes, check op_true with
vector_operand, not nonimmediate_operand.
testsuite/ChangeLog:
Backport from mainline
2018-12-10 Uros Bizjak <ubizjak@gmail.com>
PR target/88418
* gcc.target/i386/pr88418.c: New test.
Bill Schmidt [Wed, 19 Dec 2018 18:34:25 +0000 (18:34 +0000)]
backport: extend.texi (PowerPC Altivec/VSX Built-in Functions): Describe when a typedef name can be used as the type specifier for a vector type...
2018-12-19 Bill Schmidt <wschmidt@linux.ibm.com>
Backport from mainline
2018-12-18 Bill Schmidt <wschmidt@linux.ibm.com>
* doc/extend.texi (PowerPC Altivec/VSX Built-in Functions):
Describe when a typedef name can be used as the type specifier for
a vector type, and when it cannot.
Andreas Krebbel [Thu, 13 Dec 2018 12:07:58 +0000 (12:07 +0000)]
S/390: Fix zvector vec_double builtin
The (unsigned) long int to double vector conversion instructions
expect 2 immediate parameters. One for the inexact suppression
control and another one for the rounding mode. However, the
vec_double builtin has just the vector source operand. The 2
addtional operands need to be added with an intermediate expander.
The expanders were already there but unfortunately not wired up
correctly to the builtin.
gcc/ChangeLog:
2018-12-13 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2018-12-13 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390-builtins.def (s390_vec_double_s64): Map to
s390_vec_double_s64 instead of s390_vcdgb.
(s390_vec_double_u64): Map to s390_vec_double_u64 instead of
s390_vcdlgb.
gcc/testsuite/ChangeLog:
2018-12-13 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2018-12-13 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/zvector/vec-double-1.c: New test.
* gcc.target/s390/zvector/vec-double-2.c: New test.
Peter Bergner [Wed, 12 Dec 2018 17:20:41 +0000 (17:20 +0000)]
backport: re PR target/87496 (ICE in aggregate_value_p at gcc/function.c:2046)
gcc/
Backport from mainline
2018-12-07 Peter Bergner <bergner@linux.ibm.com>
PR target/87496
* config/rs6000/rs6000.c (rs6000_option_override_internal): Disallow
-mabi=ieeelongdouble and -mabi=ibmlongdouble without -mlong-double-128.
Do not error for -mabi=ibmlongdouble and no ISA 2.06 support.
* doc/invoke.texi: Document -mabi=ibmlongdouble and -mabi=ieeelongdouble
require -mlong-double-128.
gcc/testsuite/
Backport from mainline
2018-12-07 Peter Bergner <bergner@linux.ibm.com>
PR target/87496
* gcc.target/powerpc/pr87496-1.c: New test.
* gcc.target/powerpc/pr87496-2.c: New test.
* gcc.target/powerpc/pr87496-3.c: New test.
Steven G. Kargl [Wed, 12 Dec 2018 00:08:12 +0000 (00:08 +0000)]
re PR fortran/88249 (ICE in gfc_resolve_filepos, at fortran/io.c:2853)
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88249
* gfortran.h: Update prototype for gfc_resolve_filepos().
* io.c (gfc_resolve_filepos): Check for UNIT number if ERR= is present.
Use passed in locus for error message.
* resolve.c (gfc_resolve_code): Pass locus in gfc_resolve_filepos()
call.
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88249
* gfortran.dg/pr88249.f90: New test.
Steven G. Kargl [Mon, 10 Dec 2018 20:03:32 +0000 (20:03 +0000)]
re PR fortran/88269 (ICE in gfc_format_decoder, at fortran/error.c:947)
2018-12-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88269
* io.c (io_constraint): Update macro. If locus line buffer is NULL,
use gfc_current_locus in error messages.
(check_io_constraints): Catch missing IO UNIT in write and read
statements. io_constraint macro is incompatible here.
2018-12-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88269
* gfortran.dg/pr88269.f90: New test.
Janne Blomqvist [Thu, 6 Dec 2018 15:38:25 +0000 (17:38 +0200)]
Initialize backtrace state once
From backtrace.h for backtrace_create_state:
Calling this function allocates resources that can not be freed.
There is no backtrace_free_state function. The state is used to
cache information that is expensive to recompute. Programs are
expected to call this function at most once and to save the return
value for all later calls to backtrace functions.
So instead of calling backtrace_create_state every time we wish to
show a backtrace, do it once and store the result in a static
variable. libbacktrace allows multiple threads to access the state,
so no need to use TLS, but use atomic load/store to access the static
variable.
Regtested on x86_64-pc-linux-gnu.
libgfortran/ChangeLog:
2018-12-06 Janne Blomqvist <jb@gcc.gnu.org>
Backport from trunk
PR libfortran/88137
* runtime/backtrace.c (show_backtrace): Store backtrace state in a
static variable, initialize once.
Richard Biener [Wed, 28 Nov 2018 12:57:58 +0000 (12:57 +0000)]
re PR tree-optimization/79351 (Invalid tree PRE optimization around compound literal)
2018-11-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/79351
* tree-ssa-sccvn.c (vn_reference_lookup_3): For assignments from
empty CONSTRUCTORs ensure the store is at a constant position.
Iain Sandoe [Mon, 26 Nov 2018 19:49:19 +0000 (19:49 +0000)]
darwin - backport r263763 to fix PR81033
2018-11-26 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline
2018-08-22 Iain Sandoe <iain@sandoe.co.uk>
PR bootstrap/81033
PR target/81733
PR target/52795
* gcc/dwarf2out.c (FUNC_SECOND_SECT_LABEL): New.
(dwarf2out_switch_text_section): Generate a local label for the second
function sub-section and apply it as the second FDE start label.
* gcc/final.c (final_scan_insn_1): Emit second FDE label after the second
sub-section start.
Jason Merrill [Mon, 26 Nov 2018 15:53:43 +0000 (10:53 -0500)]
PR c++/87075 - ICE with constexpr array initialization.
My patch of 2016-08-26 to avoid calling a trivial default constructor
introduced TARGET_EXPRs initialized with void_node to express trivial
initialization. But when this shows up in a VEC_INIT_EXPR, we weren't
prepared to handle it. Fixed by handling it explicitly in
cxx_eval_vec_init_1.
Andreas Krebbel [Mon, 26 Nov 2018 15:29:27 +0000 (15:29 +0000)]
S/390: Fix flogr RTX.
The flogr instruction uses a 64 bit register pair target operand. In
the RTX we model this as a write to a TImode register. Unfortunately
the RTX's being assigned to the two parts of the target operand were
swapped. This is no problem if in the end the flogr instruction will
be emitted since the instruction still does what the clzdi expander
expects. However, a problem arises when the RTX is used to optimize
CLZ for a constant input operand. Even then it matters only if the
expression couldn't be folded on tree level already.
In the testcase this happened thanks to loop unrolling on RTL level.
The iteration variable is used as an argument to the clz
builtin. Due to the loop unrolling it becomes a constant and after
folding the broken RTX leads to a wrong assumption.
gcc/ChangeLog:
2018-11-26 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2018-11-20 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390.md ("clztidi2"): Swap the RTX's written to the
DImode parts of the target operand.
gcc/testsuite/ChangeLog:
2018-11-26 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2018-11-20 Andreas Krebbel <krebbel@linux.ibm.com>
Richard Biener [Mon, 26 Nov 2018 13:31:21 +0000 (13:31 +0000)]
backport: [multiple changes]
2018-11-26 Richard Biener <rguenther@suse.de>
Backport from mainline
2018-10-15 Richard Biener <rguenther@suse.de>
PR middle-end/87610
* tree-ssa-structalias.c (struct vls_data): Add escaped_p member.
(visit_loadstore): When a used restrict tag escaped verify that
the points-to solution of "other" pointers do not include
escaped.
(compute_dependence_clique): If a used restrict tag escaped
communicated that down to visit_loadstore.
* gcc.dg/torture/restrict-6.c: New testcase.
2018-10-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/87665
PR tree-optimization/87745
* tree-vectorizer.h (get_earlier_stmt): Remove.
(get_later_stmt): Pick up UID from the original non-pattern stmt.
Eric Botcazou [Thu, 22 Nov 2018 16:29:50 +0000 (16:29 +0000)]
backport: re PR rtl-optimization/85925 (compilation of masking with 257 goes wrong in combine at -02)
Backport from mainline
2018-11-21 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/85925
* gcc.c-torture/execute/20181120-1.c: Require effective target
int32plus.
(u): New variable.
(main): Compare d against u.f1 rather than 0x101. Use 0x4030201
instead of 0x10101.
Richard Biener [Tue, 20 Nov 2018 14:47:49 +0000 (14:47 +0000)]
backport: [multiple changes]
2018-11-20 Richard Biener <rguenther@suse.de>
Backport from mainline
2018-03-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/84777
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): For
force-vectorize loops ignore whether we are optimizing for size.
2018-01-26 Richard Biener <rguenther@suse.de>
PR rtl-optimization/84003
* dse.c (record_store): Only record redundant stores when
the earlier store aliases at least all accesses the later one does.
* g++.dg/torture/pr77745.C: Mark foo noinline to trigger
latent bug in DSE if NOINLINE is appropriately defined.
* g++.dg/torture/pr77745-2.C: New testcase including pr77745.C
and defining NOINLINE.
Xuepeng Guo [Tue, 20 Nov 2018 14:35:43 +0000 (14:35 +0000)]
backport: re PR target/87853 (_mm_cmpgt_epi8 broken with -funsigned-char)
Backport from mainline
2018-11-05 Xuepeng Guo <xuepeng.guo@intel.com>
PR target/87853
* config/i386/emmintrin.h (__v16qs): New to cope with option
-funsigned-char.
(_mm_cmpeq_epi8): Replace __v16qi with __v16qs.
(_mm_cmplt_epi8): Likewise.
(_mm_cmpgt_epi8): Likewise.
Eric Botcazou [Tue, 20 Nov 2018 09:04:12 +0000 (09:04 +0000)]
re PR rtl-optimization/85925 (compilation of masking with 257 goes wrong in combine at -02)
2018-11-20 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/85925
* rtl.h (word_register_operation_p): New predicate.
* combine.c (record_dead_and_set_regs_1): Only apply specific handling
for WORD_REGISTER_OPERATIONS targets to word_register_operation_p RTX.
* rtlanal.c (nonzero_bits1): Likewise. Adjust couple of comments.
(num_sign_bit_copies1): Likewise.
Eric Botcazou [Thu, 8 Nov 2018 15:58:16 +0000 (15:58 +0000)]
fe.h (Suppress_Checks): Declare.
* fe.h (Suppress_Checks): Declare.
* gcc-interface/misc.c (gnat_init_gcc_eh): Set -fnon-call-exceptions
only if checks are not suppressed and -faggressive-loop-optimizations
only if they are.
* gcc-interface/trans.c (struct loop_info_d): Remove has_checks and
warned_aggressive_loop_optimizations fields.
(gigi): Do not clear warn_aggressive_loop_optimizations here.
(Raise_Error_to_gnu): Do not set has_checks.
(gnat_to_gnu) <N_Indexed_Component>: Remove support for aggressive
loop optimizations.
Max Filippov [Wed, 7 Nov 2018 20:52:29 +0000 (20:52 +0000)]
gcc: xtensa: don't force PIC for uclinux target
xtensa-uclinux uses bFLT executable file format that cannot relocate
fields representing offsets from data to code. C++ objects built as PIC
use offsets to encode FDE structures. As a result C++ exception handling
doesn't work correctly on xtensa-uclinux. Don't use PIC by default on
xtensa-uclinux.
gcc/
2018-11-07 Max Filippov <jcmvbkbc@gmail.com>
Backport from mainline
2018-11-05 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0.
compiler: handle abstract type in builtin numeric const value
Builtin_call_expression::do_numeric_constant_value can be called by
Array_type::verify_length before the determine types pass, so accept
an abstract type.