Re: [PATCH] Fix C++ ref op= ICE in the gimplifier with -g (PR c++/84704)

2018-03-05 Thread Richard Biener
On Tue, 6 Mar 2018, Jakub Jelinek wrote: > On Tue, Mar 06, 2018 at 02:28:40AM -0300, Alexandre Oliva wrote: > > On Mar 5, 2018, Jakub Jelinek wrote: > > > > > * tree.c (stabilize_reference_1): Return save_expr (e) for > > > STATEMENT_LIST even if it doesn't have

Re: [PATCH] deprecate -finline-limit and make it an optimization option (PR 84603)

2018-03-05 Thread Richard Biener
On Sat, 3 Mar 2018, Martin Sebor wrote: > On 03/02/2018 01:05 AM, Richard Biener wrote: > > On Thu, 1 Mar 2018, Martin Sebor wrote: > > > > > While testing my recent changes to the handling of attributes > > > on C++ templates I noticed that the -finline-limit=N option > > > is not recognized in

Re: [PATCH] PR fortran/56667 -- Issue a sane error message

2018-03-05 Thread Thomas Koenig
Hi Steve, For the mangled code in the new testcase, gfortran issues a somewhat obtuse error message. The problem is the matcher for a complex entity runs prior to the matcher for an implied do-loop. Errors are queued in that order so an error messagei for a mangled complex constant is

Re: [PR84620] output symbolic entry_view as data2, not addr

2018-03-05 Thread Jakub Jelinek
On Tue, Mar 06, 2018 at 03:13:11AM -0300, Alexandre Oliva wrote: > On Mar 2, 2018, Alexandre Oliva wrote: > > > Mark Wielaard is implementing support for LVU and IEPM in elfutils, and > > he was surprised by the encoding of DW_AT_GNU_entry_view; so was I! > > When GCC

Re: [PATCH] Fix C++ ref op= ICE in the gimplifier with -g (PR c++/84704)

2018-03-05 Thread Jakub Jelinek
On Tue, Mar 06, 2018 at 02:28:40AM -0300, Alexandre Oliva wrote: > On Mar 5, 2018, Jakub Jelinek wrote: > > > * tree.c (stabilize_reference_1): Return save_expr (e) for > > STATEMENT_LIST even if it doesn't have side-effects. > > I'm concerned about codegen

Re: [PATCH] Fix ICE with exp.simdclone.0 (PR tree-optimization/84687)

2018-03-05 Thread Richard Biener
On March 5, 2018 9:40:28 PM GMT+01:00, Jakub Jelinek wrote: >Hi! > >This patch clears DECL_BUILT_IN on simd clones, similarly how >cgraphclones.c >does: > /* When signature changes, we need to clear builtin info. */ > if (DECL_BUILT_IN (new_decl) > && args_to_skip >

Re: [PR c++/84593] ice on braced init with uninit ref field

2018-03-05 Thread Alexandre Oliva
On Mar 2, 2018, Jason Merrill wrote: >> + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE); >> + init = fold (convert (type, integer_zero_node)); > Maybe build_zero_cst? > OK either way. Here's what I'm installing: [PR c++/84593] ice on braced init with uninit ref

Re: [PR84620] output symbolic entry_view as data2, not addr

2018-03-05 Thread Alexandre Oliva
On Mar 2, 2018, Alexandre Oliva wrote: > Mark Wielaard is implementing support for LVU and IEPM in elfutils, and > he was surprised by the encoding of DW_AT_GNU_entry_view; so was I! > When GCC computes and outputs views internally (broken without internal > view resets), it

Re: [C++] [PR84231] overload on cond_expr in template

2018-03-05 Thread Alexandre Oliva
On Mar 2, 2018, Jason Merrill wrote: > Let's add a comment along the lines of > /* Let lvalue_kind know this was a glvalue. */ > OK with that change. Thanks, here's what I'm about to check in. [C++] [PR84231] overload on cond_expr in template A non-type-dependent

Re: [PR c++/84593] ice on braced init with uninit ref field

2018-03-05 Thread Alexandre Oliva
On Mar 2, 2018, Jason Merrill wrote: > On Fri, Mar 2, 2018 at 2:57 AM, Alexandre Oliva wrote: >> + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE); >> + init = fold (convert (type, integer_zero_node)); > Maybe build_zero_cst? Sure. I wonder,

Re: [PATCH] Fix C++ ref op= ICE in the gimplifier with -g (PR c++/84704)

2018-03-05 Thread Alexandre Oliva
On Mar 5, 2018, Jakub Jelinek wrote: > * tree.c (stabilize_reference_1): Return save_expr (e) for > STATEMENT_LIST even if it doesn't have side-effects. I'm concerned about codegen differences in case the statement list is created because of debug stmts not

Re: [RFA][PATCH][PR middle-end/61118] Improve tree CFG accuracy for setjmp/longjmp

2018-03-05 Thread Jeff Law
On 03/05/2018 12:30 PM, Michael Matz wrote: > Hi, > > On Mon, 5 Mar 2018, Jeff Law wrote: > The single successor test was strictly my paranoia WRT abnormal/EH edges. I don't immediately see why the CFG would be incorrect if the successor of the setjmp block has

[committed] Fix infinite recursion in combine_simplify_rtx (PR target/84700)

2018-03-05 Thread Jakub Jelinek
Hi! On the following testcase on powerpc64-linux -m32 we end up calling combine_simplify_rtx on (plus:SI (ltu:SI (plus:SI (if_then_else:SI (eq (reg:CC 147) (const_int 0 [0])) (subreg:SI (reg:DI 126) 4) (reg:SI 146)) (subreg:SI

Re: [PATCH] replace ICE with error for failed template deduction (PR 84355)

2018-03-05 Thread Martin Sebor
On 02/23/2018 07:32 PM, Jason Merrill wrote: On Sun, Feb 18, 2018 at 11:39 PM, Jason Merrill wrote: On Fri, Feb 16, 2018 at 4:33 PM, Martin Sebor wrote: On 02/16/2018 07:04 AM, Jason Merrill wrote: On Thu, Feb 15, 2018 at 6:36 PM, Martin Sebor

[PATCH] Fix ICE with exp.simdclone.0 (PR tree-optimization/84687)

2018-03-05 Thread Jakub Jelinek
Hi! This patch clears DECL_BUILT_IN on simd clones, similarly how cgraphclones.c does: /* When signature changes, we need to clear builtin info. */ if (DECL_BUILT_IN (new_decl) && args_to_skip && !bitmap_empty_p (args_to_skip)) { DECL_BUILT_IN_CLASS (new_decl) =

C++ PATCH for c++/84708, ICE with lambda in local class NSDMI

2018-03-05 Thread Jason Merrill
Looking for fake NSDMI 'this' in scope_chain only works for non-local classes. But if we can't find it, we can make our own fake. Tested x86_64-pc-linux-gnu, applying to trunk. commit 8fd062c984befc3419f8a0a61224d0f4ecf02495 Author: Jason Merrill Date: Mon Mar 5 16:45:36

Re: [C++ PATCH] Small performance improvement for constexpr_call_hasher::equal (PR c++/84684)

2018-03-05 Thread Jason Merrill
OK. On Mon, Mar 5, 2018 at 3:31 PM, Jakub Jelinek wrote: > Hi! > > This doesn't actually fix this PR (Marek is working on that), but > just something I've noticed while analyzing the PR. > We have the hashes saved in the structure (to speed up hash table > expansion), so it is

Re: [PATCH] [ARC] Cleanup unused functions.

2018-03-05 Thread Andrew Burgess
* Claudiu Zissulescu [2018-02-20 15:38:32 +0200]: > From: Claudiu Zissulescu > > Cleanup unsed functions and macros. > > OK to apply? > Claudiu Looks good. Nice cleanup. Thanks, Andrew > > gcc/ > 2018-01-26 Claudiu Zissulescu

[PATCH] Fix C++ ref op= ICE in the gimplifier with -g (PR c++/84704)

2018-03-05 Thread Jakub Jelinek
Hi! The following testcase ICEs, because ARRAY_REF on lhs of op= has a statement list with no side-effects as index (containing DEBUG_BEGIN_STMT and integer_zero_node), stabilize_reference does nothing to it (as it has no side-effects), then the array ref is unshared in unshare_body

[PATCH] accept attribute nonstring on all narrow characters (PR 84725)

2018-03-05 Thread Martin Sebor
Attribute nonstring is currently only allowed on arrays and pointers to plain char, but -Wstringop-truncation triggers even for strncpy calls whose arguments are arrays of signed or unsigned char (with or without a cast to char*). To help deal with -Wstringop-truncation in the Linux kernel it

[PATCH] Fix reg-stack error-recovery ICE (PR inline-asm/84683)

2018-03-05 Thread Jakub Jelinek
Hi! If we discover some bad inline-asm during reg-stack processing and we error on those, we replace that inline-asm with a (use (const_int 0)) and therefore the various assumptions of reg-stack pass may not hold. Seems we already have a couple of spots which are more permissive if

[C++ PATCH] Small performance improvement for constexpr_call_hasher::equal (PR c++/84684)

2018-03-05 Thread Jakub Jelinek
Hi! This doesn't actually fix this PR (Marek is working on that), but just something I've noticed while analyzing the PR. We have the hashes saved in the structure (to speed up hash table expansion), so it is a waste not to test those also in the equal hook, by giving up cheaply in cases of hash

Re: [RFA][PATCH][PR middle-end/61118] Improve tree CFG accuracy for setjmp/longjmp

2018-03-05 Thread Michael Matz
Hi, On Mon, 5 Mar 2018, Jeff Law wrote: > >> The single successor test was strictly my paranoia WRT abnormal/EH > >> edges. > >> > >> I don't immediately see why the CFG would be incorrect if the > >> successor of the setjmp block has multiple preds. > > > > Actually, without further

Re: [PATCH] [Microblaze]: PIC Data Text Relative

2018-03-05 Thread Michael Eager
On 03/02/2018 08:12 AM, Andrew Sadek wrote: Hello Michael, I tried running the whole GCC test suite on the current head (without my patch) along with 'microblaze-qemu' but I have the following problems: 1) The test is hanging at 'gcc.c-torture/string-large-1.c' , the gcc is making a 100%

[PATCH] rs6000: Don't align tiny loops to 32 bytes for POWER9

2018-03-05 Thread Segher Boessenkool
For POWER4..POWER8 we align loops of 5..8 instructions to 32 bytes (instead of to 16 bytes) because that executes faster. This is no longer the case on POWER9, so we can just as well only align to 16 bytes. Bootstrapped and tested on a p9 powerpc64le-linux. Committing to trunk. Segher

[PATCH] PR fortran/56667 -- Issue a sane error message

2018-03-05 Thread Steve Kargl
For the mangled code in the new testcase, gfortran issues a somewhat obtuse error message. The problem is the matcher for a complex entity runs prior to the matcher for an implied do-loop. Errors are queued in that order so an error messagei for a mangled complex constant is emitted. Regression

Re: [RFA][PATCH][PR middle-end/61118] Improve tree CFG accuracy for setjmp/longjmp

2018-03-05 Thread Jeff Law
On 03/05/2018 11:30 AM, Michael Matz wrote: > Hi, > > On Wed, 28 Feb 2018, Jeff Law wrote: > >> The single successor test was strictly my paranoia WRT abnormal/EH edges. >> >> I don't immediately see why the CFG would be incorrect if the successor >> of the setjmp block has multiple preds. > >

Re: [config patch] Fwd from binutils: add ax_pthread.m4 to config/ directory

2018-03-05 Thread Joshua Watt
On Fri, 2018-02-23 at 08:54 -0600, Joshua Watt wrote: > On Mon, 2018-02-19 at 17:24 -0800, Cary Coutant wrote: > > Please see this patch posted to the binutils list: > > > >https://sourceware.org/ml/binutils/2018-02/msg00260.html > > > > where Joshua proposes to add the ax_pthread.m4 script,

libgo patch committed: Fix typo in mksysinfo.sh script

2018-03-05 Thread Ian Lance Taylor
This libgo patch by Than McIntosh fixes a small typo in the mksysinfo.sh script (incorrect input file for a grep command). Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE

[PR c++/84702] ICE with default tmpl arg of overload set

2018-03-05 Thread Nathan Sidwell
This fixes an ICE where we were not correctly marking a lookup as kept, resulting in an assertion failure later on. nathan -- Nathan Sidwell 2018-03-05 Nathan Sidwell PR c++/84702 * pt.c (process_template_arg): Mark lookup_keep on a default arg. PR c++/84702 *

Patch ping

2018-03-05 Thread Jakub Jelinek
Hi! I'd like to ping following patch: http://gcc.gnu.org/ml/gcc-patches/2018-02/msg01461.html PR84564 - fix ICE with -mforce-indirect-call Thanks Jakub

Re: [RFA][PATCH][PR middle-end/61118] Improve tree CFG accuracy for setjmp/longjmp

2018-03-05 Thread Michael Matz
Hi, On Wed, 28 Feb 2018, Jeff Law wrote: > The single successor test was strictly my paranoia WRT abnormal/EH edges. > > I don't immediately see why the CFG would be incorrect if the successor > of the setjmp block has multiple preds. Actually, without further conditions I don't see how it

[PATCH][GCC][ARM] Fix can_change_mode_class for big-endian

2018-03-05 Thread Tamar Christina
Hi All, Taking the subreg of a vector mode on big-endian may result in an infinite recursion and eventually a segfault once we run out of stack space. As an example, taking a subreg of V4HF to SImode we end up in the following loop on big-endian: #861 0x008462e9 in operand_subword_force

Re: Rename __builtin_rs6000_speculation_barrier

2018-03-05 Thread Segher Boessenkool
On Mon, Mar 05, 2018 at 09:58:50AM -0600, Bill Schmidt wrote: > > > On Mar 5, 2018, at 9:04 AM, Segher Boessenkool > > wrote: > > > > Hi! > > > > On Sun, Mar 04, 2018 at 01:52:20PM -0600, Bill Schmidt wrote: > >> We realized recently that the use of "rs6000" in a

Re: Patch ping

2018-03-05 Thread Jan Hubicka
Dne 2018-03-05 17:13, Jakub Jelinek napsal: Hi! I'd like to ping following patch: http://gcc.gnu.org/ml/gcc-patches/2018-02/msg01461.html PR84564 - fix ICE with -mforce-indirect-call OK, thanks! Honza Thanks Jakub

[PR c++/84694] ICE on template friend decl

2018-03-05 Thread Nathan Sidwell
This fixes an ICE with a friend decl. Although the reported source is invalid, we can turn it into valid, but useless, source. ISTM that we should be generating a raw identifier_node here, but finding the TEMPLATE_DECL at parse time. But that's a change for another day. This restores the

Re: C++ PATCH for c++/84707, ICE with nested anonymous namespace

2018-03-05 Thread Nathan Sidwell
On 03/05/2018 09:47 AM, Marek Polacek wrote: Since Nathan's r253489 we seem to not use anon_identifier anymore; rather, the DECL_NAME is simply NULL. This crashed in duplicate_decls on this invalid code because UDLIT_OPER_P was blithely used on a possibly null tree. Other spots in this

Re: Rename __builtin_rs6000_speculation_barrier

2018-03-05 Thread Bill Schmidt
> On Mar 5, 2018, at 9:04 AM, Segher Boessenkool > wrote: > > Hi! > > On Sun, Mar 04, 2018 at 01:52:20PM -0600, Bill Schmidt wrote: >> We realized recently that the use of "rs6000" in a builtin name doesn't agree >> with our normal naming conventions. Thus this

Re: Patch ping

2018-03-05 Thread Kirill Yukhin
Hello Jakub, On Friday, March 2, 2018, Jakub Jelinek wrote: > Hi! > > I'd like to ping 2 patches: > > http://gcc.gnu.org/ml/gcc-patches/2018-02/msg01340.html > - PR target/84524 avx512* wrong-code bug Patch is OK. > >

Re: [RFC][PR82479] missing popcount builtin detection

2018-03-05 Thread Richard Biener
On Thu, Feb 8, 2018 at 1:41 AM, Kugan Vivekanandarajah wrote: > Hi Richard, > > On 1 February 2018 at 23:21, Richard Biener > wrote: >> On Thu, Feb 1, 2018 at 5:07 AM, Kugan Vivekanandarajah >>

Re: Rename __builtin_rs6000_speculation_barrier

2018-03-05 Thread Segher Boessenkool
Hi! On Sun, Mar 04, 2018 at 01:52:20PM -0600, Bill Schmidt wrote: > We realized recently that the use of "rs6000" in a builtin name doesn't agree > with our normal naming conventions. Thus this patch changes such a builtin > to __builtin_powerpc_speculation_barrier instead. > > Bootstrapped and

[PATCH] Fix PR84486

2018-03-05 Thread Richard Biener
The following fixes a missed optimization caused by code hoisting. When PRE inserts expressions somewhere the SSA names created in that process do not have any associated info like alignment. Fixed for the very specific case of __builtin_assume_aligned. Bootstrapped and tested on

Re: [PATCH, rs6000] Fix PR84264: ICE in rs6000_emit_le_vsx_store

2018-03-05 Thread Segher Boessenkool
Hi Peter, On Sat, Mar 03, 2018 at 10:55:28PM -0600, Peter Bergner wrote: > In PR84264, we hit an assert in rs6000_emit_le_vsx_store causing an ICE > in LRA. We get there, because LRA called the movv4si expander to generate > a spill and the mov pattern calls rs6000_emit_le_vsx_move which in turn

C++ PATCH for c++/84707, ICE with nested anonymous namespace

2018-03-05 Thread Marek Polacek
Since Nathan's r253489 we seem to not use anon_identifier anymore; rather, the DECL_NAME is simply NULL. This crashed in duplicate_decls on this invalid code because UDLIT_OPER_P was blithely used on a possibly null tree. Other spots in this function check this, too. Bootstrapped/regtested on

Re: Don't vectorise zero-step rmw operations (PR 84485)

2018-03-05 Thread Richard Biener
On Fri, Mar 2, 2018 at 3:12 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Thu, Mar 1, 2018 at 12:38 PM, Richard Sandiford >> wrote: >>> Richard Biener writes:

Re: [C++ Patch] PR 84618 ("[8 Regression] ICE in build_capture_proxy, at cp/lambda.c:460")

2018-03-05 Thread Jason Merrill
OK. On Sun, Mar 4, 2018 at 8:55 PM, Paolo Carlini wrote: > Hi, > > a rather simple ice on invalid (not sure why only P4 given that no > meaningful diagnostic is emitted before ICEing). What happens is that the > ill-formed capture naming b, an OVERLOAD, escapes the

Re: [RFA][PATCH][PR middle-end/61118] Improve tree CFG accuracy for setjmp/longjmp

2018-03-05 Thread Richard Biener
On Fri, Mar 2, 2018 at 11:18 PM, Jeff Law wrote: > On 02/28/2018 03:43 AM, Richard Biener wrote: > [ More snipping ] > >> >>> It's actually pretty easy to fix the CFG. We just need to recognize >>> that a "returns twice" function returns not to the call, but to the >>> point

Re: [PR c++/84497] ref to undefined tls init

2018-03-05 Thread Nathan Sidwell
On 03/02/2018 01:43 PM, Jason Merrill wrote: On Fri, Mar 2, 2018 at 11:07 AM, Nathan Sidwell wrote: NEEDS_CONSTRUCTING && !HAS_CONSTEXPR_CTOR && !HAS_DEFAULT_CONSTRUCTOR seems like it would be sufficient. and indeed that works in this case. Do you mean !HAS_TRIVIAL_DFLT

[PATCH] Fix PR84650

2018-03-05 Thread Richard Biener
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2018-03-05 Richard Biener PR tree-optimization/84650 * tree-ssa-loop-im.c (pass_lim::execute): Reset the SCEV cache if executed in the loop pipeline. *

PING: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-05 Thread H.J. Lu
On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: > For x86 targets, when -fno-plt is used, external functions are called > via GOT slot, in 64-bit mode: > > [bnd] call/jmp *foo@GOTPCREL(%rip) > > and in 32-bit mode: > > [bnd] call/jmp *foo@GOT[(%reg)] > >

PING: [PATCH] i386: Don't generate alias for function return thunk

2018-03-05 Thread H.J. Lu
On Mon, Feb 26, 2018 at 12:48 PM, H.J. Lu wrote: > Function return thunks shouldn't be aliased to indirect branch thunks > since indirect branch thunks are placed in COMDAT section and a COMDAT > section with indirect branch may not have function return thunk. This > patch

[PATCH][1/2] Fix PR84670

2018-03-05 Thread Richard Biener
The following fixes a thinko in the assert I added. It's true that the value-set of ANTIC_IN shouldn't grow during iteration but there's an exception for when the successors we intersect are not all visited (recursively). For example when the latch wasn't visited and thus its ANTIC_IN is first

[PATCH] S/390: libatomic: Fix 16 byte atomic exchange

2018-03-05 Thread Andreas Krebbel
The compiler builtin will use the hardware instruction cdsg if the memory operand is properly aligned and will fall back to the library call otherwise. In case the compiler for one part is able to detect that the location is aligned and fails to do so for another usage of the hw instruction and