Re: [PATCH] Fix and improve tree-object-size.c pass_through_call

2017-11-24 Thread Richard Biener
On Thu, 23 Nov 2017, Jakub Jelinek wrote: > Hi! > > As mentioned on IRC, we can actually now use ERF_RETURN*_ARG* to find out > what functions are pass through (except for __builtin_assume_aligned, which > is pass through but we never want to propagate the arg to the result early, as > the result

Re: [PATCH] Fix ubsan on mingw hosts (PR sanitizer/83014)

2017-11-24 Thread Richard Biener
On Thu, 23 Nov 2017, Jakub Jelinek wrote: > Hi! > > From my reading of the PR and looking around, I believe the reason > ubsan ICEs on mingw hosts is that it is the only host that redefines > HOST_LONG_LONG_FORMAT to "I64" instead of the usual "ll", but "%I64" > is nothing pp_format can handle, a

Re: [PATCH][i386,AVX] Enable VBMI2 support [2/7]

2017-11-24 Thread Eric Botcazou
> This seems to break the build for me: > > In file included from > /home/glisse/repos/gcc/trunk/gcc/config/i386/i386.c:21:0: > /home/glisse/repos/gcc/trunk/gcc/config/i386/i386.c:30165:16: error: > ‘IX86_BUILTIN__BDESC_SPECIAL_ARGS2_FIRST’ was not declared in this scope > BDESC_VERIFYS (IX86_BU

Re: [PATCH][i386,AVX] Enable VBMI2 support [2/7]

2017-11-24 Thread Jakub Jelinek
On Fri, Nov 24, 2017 at 09:34:07AM +0100, Eric Botcazou wrote: > > This seems to break the build for me: > > > > In file included from > > /home/glisse/repos/gcc/trunk/gcc/config/i386/i386.c:21:0: > > /home/glisse/repos/gcc/trunk/gcc/config/i386/i386.c:30165:16: error: > > ‘IX86_BUILTIN__BDESC_SPE

Re: [patch, fortran] Implement maxloc and minloc for character

2017-11-24 Thread Janne Blomqvist
On Thu, Nov 23, 2017 at 7:58 PM, Thomas Koenig wrote: > Hi Janne, > >> However, to continue my nitpicking (sorry!), it seems that in many >> cases compare_fcn still takes an integer length argument. Could you >> make that gfc_charlen_type as well? Or maybe size_t, since the >> argument is passed s

Re: Simplify ptr - 0

2017-11-24 Thread Marc Glisse
On Thu, 23 Nov 2017, Richard Biener wrote: What about 0 - ptr? (ok, that's even more weird) * match.pd (0-ptr): New transformation. Regtested on gcc112. -- Marc GlisseIndex: gcc/match.pd === --- gcc/match.pd (revision 2

Re: [PATCH][GCC][ARM] Dot Product NEON intrinsics [Patch (3/8)]

2017-11-24 Thread Kyrill Tkachov
Hi Christophe, On 23/11/17 23:26, Christophe Lyon wrote: On 22 November 2017 at 12:26, Kyrill Tkachov wrote: Hi Tamar, On 06/11/17 16:53, Tamar Christina wrote: Hi All, This patch adds the NEON intrinsics for Dot product. Dot product is available from ARMv8.2-a and onwards. Regtested on

[PATCH] Fix PR83128

2017-11-24 Thread Richard Biener
We somehow forgot to handle STRING_CSTs when looking through memcpy like functions. Fixed as follows, bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2017-11-24 Richard Biener PR tree-optimization/83128 * tree-ssa-sccvn.c (fully_constant_vn_reference_

Re: [PATCH][i386,AVX] Enable VBMI2 support [2/7]

2017-11-24 Thread Kirill Yukhin
On 24 Nov 09:35, Jakub Jelinek wrote: > On Fri, Nov 24, 2017 at 09:34:07AM +0100, Eric Botcazou wrote: > > > This seems to break the build for me: > > > > > > In file included from > > > /home/glisse/repos/gcc/trunk/gcc/config/i386/i386.c:21:0: > > > /home/glisse/repos/gcc/trunk/gcc/config/i386/i3

RE: [PATCH][GCC][ARM] Dot Product NEON intrinsics [Patch (3/8)]

2017-11-24 Thread Tamar Christina
> > > Not sure if Kyrill actually meant to comment about the three lines above, but > they have a bug: > #if should be before #pragma GCC push_options. > > Indeed, after this patch was committed (r255064), I've noticed many > regressions, for instance > p64_p128 is now unsupported. This is because

Re: [RFC, PR 80689] Copy small aggregates element-wise

2017-11-24 Thread Richard Biener
On Thu, Nov 23, 2017 at 4:32 PM, Martin Jambor wrote: > Hi, > > On Mon, Nov 13 2017, Richard Biener wrote: >> The main concern here is that GIMPLE is not very well defined for >> aggregate copies and that gimple-fold.c happily optimizes >> memcpy (&a, &b, sizeof (a)) into a = b; >> >> struct A { s

Re: [PATCH 1/4] [SPARC] Errata workaround for GRLIB-TN-0012

2017-11-24 Thread Eric Botcazou
> 2017-11-17 Daniel Cederman > > * config/sparc/sparc.c (fpop_insn_p): New function. > (sparc_do_work_around_errata): Insert NOP instructions to > prevent sequences that could trigger the TN-0012 errata for > GR712RC. > (pass_work_around_errata::gate): Also test sp

Re: [PATCH 2/4] [SPARC] Errata workaround for GRLIB-TN-0011

2017-11-24 Thread Eric Botcazou
> 2017-11-17 Daniel Cederman > > * config/sparc/sync.md (swapsi): 16-byte align if sparc_fix_gr712rc. > (atomic_compare_and_swap_leon3_1): Likewise. > (ldstub): Likewise. You need to adjust the "length" attribute accordingly (and conservatively), see atomic_compare_and_swapd

Re: [PATCH 3/4] [SPARC] Errata workaround for GRLIB-TN-0010

2017-11-24 Thread Eric Botcazou
> 2017-11-17 Daniel Cederman > > * config/sparc/sparc.c (atomic_insn_p): New function. > (sparc_do_work_around_errata): Insert NOP instructions to > prevent sequences that could trigger the TN-0010 errata for > UT700. > * config/sparc/sync.md (atomic_compare_and_sw

Re: [RFC, PR 80689] Copy small aggregates element-wise

2017-11-24 Thread Richard Biener
On Fri, Nov 24, 2017 at 11:31 AM, Richard Biener wrote: > On Thu, Nov 23, 2017 at 4:32 PM, Martin Jambor wrote: >> Hi, >> >> On Mon, Nov 13 2017, Richard Biener wrote: >>> The main concern here is that GIMPLE is not very well defined for >>> aggregate copies and that gimple-fold.c happily optimiz

Re: [RFC, PR 80689] Copy small aggregates element-wise

2017-11-24 Thread Richard Biener
On Fri, Nov 24, 2017 at 11:57 AM, Richard Biener wrote: > On Fri, Nov 24, 2017 at 11:31 AM, Richard Biener > wrote: >> On Thu, Nov 23, 2017 at 4:32 PM, Martin Jambor wrote: >>> Hi, >>> >>> On Mon, Nov 13 2017, Richard Biener wrote: The main concern here is that GIMPLE is not very well defin

Re: [PATCH 4/4] [SPARC] Errata workaround for GRLIB-TN-0013

2017-11-24 Thread Eric Botcazou
> 2017-11-17 Daniel Cederman > > * config/sparc/sparc.c (fpop_reg_depend_p): New function. > (div_sqrt_insn_p): New function. > (sparc_do_work_around_errata): Insert NOP instructions to > prevent sequences that could trigger the TN-0013 errata for > certain LEON3 p

Fix bootstrap miscompare when stage1 is built with different chekcing setting

2017-11-24 Thread Jan Hubicka
Hi, I have disabled inliner cache sanity check for profile feedback because profile count scaling now can cause small roundoff deviations (a cost we had to pay for dropping separate frequencies I guess). While doing so I missed that the code block must set current_badness even when not doing any ch

Re: [RFC, PR 80689] Copy small aggregates element-wise

2017-11-24 Thread Martin Jambor
Hi Richi, On Fri, Nov 24 2017, Richard Biener wrote: > On Fri, Nov 24, 2017 at 11:57 AM, Richard Biener > wrote: >> On Fri, Nov 24, 2017 at 11:31 AM, Richard Biener .. > And yes, I've been worried about SRA as well here... it _does_ > have some early outs when seeing VIEW_CONVERT_EXPR

Re: [RFC, PR 80689] Copy small aggregates element-wise

2017-11-24 Thread Richard Biener
On Fri, Nov 24, 2017 at 12:53 PM, Martin Jambor wrote: > Hi Richi, > > On Fri, Nov 24 2017, Richard Biener wrote: >> On Fri, Nov 24, 2017 at 11:57 AM, Richard Biener >> wrote: >>> On Fri, Nov 24, 2017 at 11:31 AM, Richard Biener > > .. > >> And yes, I've been worried about SRA as well here...

Re: Simplify ptr - 0

2017-11-24 Thread Richard Biener
On Fri, Nov 24, 2017 at 10:18 AM, Marc Glisse wrote: > On Thu, 23 Nov 2017, Richard Biener wrote: > >> What about 0 - ptr? (ok, that's even more weird) > > > * match.pd (0-ptr): New transformation. > > Regtested on gcc112. Ok. Thanks, Richard. > -- > Marc Glisse > Index: gcc/match.pd >

[PATCH] [pr#83069] Keep profile_count for bb under real_bb_freq_max

2017-11-24 Thread Siddhesh Poyarekar
freq_max < 1, i.e. highest frequency among bbs in the function being higher than real_bb_freq_max means that the bb ends up with a profile count larger than real_bb_freq_max and then can go all the way up to and beyond profile_count::max_count. Bootstrapped on aarch64, testsuite in progress.

[PATCH] Fix PR82402

2017-11-24 Thread Richard Biener
The following fixes a missing SSA_NAME_OCCURS_IN_ABNORMAL_PHI. Tested on x86_64-unknown-linux-gnu, applied. Richard. 2017-11-24 Richard Biener PR tree-optimization/82402 * tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly set SSA_NAME_OCCURS_IN_ABNORMAL

Re: [RFC, PR 80689] Copy small aggregates element-wise

2017-11-24 Thread Martin Jambor
On Fri, Nov 24 2017, Richard Biener wrote: > On Fri, Nov 24, 2017 at 12:53 PM, Martin Jambor wrote: >> Hi Richi, >> >> On Fri, Nov 24 2017, Richard Biener wrote: >>> On Fri, Nov 24, 2017 at 11:57 AM, Richard Biener >>> wrote: On Fri, Nov 24, 2017 at 11:31 AM, Richard Biener >> >> .. >> >

Re: [RFC, PR 80689] Copy small aggregates element-wise

2017-11-24 Thread Richard Biener
On Fri, Nov 24, 2017 at 2:00 PM, Martin Jambor wrote: > On Fri, Nov 24 2017, Richard Biener wrote: >> On Fri, Nov 24, 2017 at 12:53 PM, Martin Jambor wrote: >>> Hi Richi, >>> >>> On Fri, Nov 24 2017, Richard Biener wrote: On Fri, Nov 24, 2017 at 11:57 AM, Richard Biener wrote: > On

Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new

2017-11-24 Thread Marc Glisse
Hello, @@ -4247,9 +4248,20 @@ build_operator_new_call (tree fnname, vec **args, we disregard block-scope declarations of "operator new". */ fns = lookup_function_nonclass (fnname, *args, /*block_p=*/false); + if (align_arg) +{ + vec* align_args + = vec_copy_and_insert

Re: [C++ PATCH] Fix -fsanitize={null,alignment} of references (PR c++/79572)

2017-11-24 Thread Maxim Kuvyrkov
On Thu, Mar 23, 2017 at 11:37 PM, Jakub Jelinek wrote: > Hi! > > Since late C++ folding has been committed, we don't sanitize some reference > bindings to NULL. Earlier we had always NOP_EXPR to REFERENCE_TYPE say from > INTEGER_CST or whatever else, but cp_fold can now turn that right into > INT

Re: [C++ PATCH] Fix -fsanitize={null,alignment} of references (PR c++/79572)

2017-11-24 Thread Jakub Jelinek
On Fri, Nov 24, 2017 at 05:16:27PM +0300, Maxim Kuvyrkov wrote: > Using __builtin_printf causes this test to fail sporadically when > cross-testing. Stdout and stderr output can get mixed in > cross-testing, so dejagnu might see > == > g++.dg/ubsan/null-8.C:18:7: runtime error: reference binding t

[PATCH, i386] Fix registers type for MODE_TI

2017-11-24 Thread Shalnov, Sergey
Hi, I found wrong ymm registers are generated in case of "-march=skylake-avx512 -mprefer-vector-width=128" options set The code looks like: movq%r11, 64(%rbx) vpxord %ymm0, %ymm0, %ymm0 vmovdqa64 %xmm0, 32(%rbx) movq%r11, 15584(%rbx) where MODE_TI

[PATCH][ARM] Fix wrong code by arm_final_prescan with fp16 move instructions

2017-11-24 Thread Sudakshina Das
Hi For the following test case: __fp16 test_select (__fp16 a, __fp16 b, __fp16 c) { return (a < b) ? b : c; } when compiled with -mfpu=fp-armv8 -march=armv8.2-a+fp16 -marm -mfloat-abi=hard trunk generates wrong code: test_select: @ args = 0, pretend = 0, frame = 0 @ frame_ne

[RFC] Generate sub-tests from libgomp.c/for-{3,5,6}.c

2017-11-24 Thread Tom de Vries
[ add missing cc gcc-patches ] On 11/24/2017 04:31 PM, Tom de Vries wrote: Hi, The libgomp offloading tests libgomp.c/for-{3,5,6}.c are monolithic tests which test lots of subtests, and if any of them fail, it would be good to be able to quickly known which subtest(s) fail. [ And if you fix

[PATCH, i386] Fix wrong instruction vpcmpeqd generation

2017-11-24 Thread Shalnov, Sergey
Hi, I found wrong vpcmpeqd instruction form generated in case of "-march=skylake-avx512 -mprefer-vector-width=128" options set The compiler emits following error at compile stage: Error: invalid register operand for `vpcmpeqd' Because following was generated: vpcmpeqd %xmm16, %xmm

Re: [0/4] [AArch64] Add SVE support

2017-11-24 Thread Richard Sandiford
Richard Sandiford writes: > This series adds support for ARM's Scalable Vector Extension. > More details on SVE can be found here: > > > https://developer.arm.com/products/architecture/a-profile/docs/arm-architecture-reference-manual-supplement-armv8-a > > There are four parts for ease of revie

Re: [PATCH][GCC][ARM] Dot Product NEON intrinsics [Patch (3/8)]

2017-11-24 Thread Christophe Lyon
On 24 November 2017 at 11:31, Tamar Christina wrote: >> > >> Not sure if Kyrill actually meant to comment about the three lines above, but >> they have a bug: >> #if should be before #pragma GCC push_options. >> >> Indeed, after this patch was committed (r255064), I've noticed many >> regressions,

[PR 81248] Fix ipa-sra size check

2017-11-24 Thread Martin Jambor
Hi, PR 81248 is a missed-optimization bug when SRA refuses to replace a pointer to a one-field structure to just passing the field by value. The problem is a bogus check which compares the size of the replacement with the size of the aggregate, even when it is passed by reference, which was not th

[PATCH] Fix typo in unordered_map deduction guide, missing "typename ="

2017-11-24 Thread Stephan Bergmann
Otherwise, at least recent Clang trunk with -std=gnu++17 complains In file included from lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/functional:60: In file included from lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/unordered_map:47: lib/gcc/x86_64-pc-linu

[PATCH] Missing noexcept in string_view::find_first_of declaration

2017-11-24 Thread Stephan Bergmann
>From 0a75fbb0c16e216892d16f1ba3448471e33f61bb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 24 Nov 2017 18:04:30 +0100 Subject: [PATCH] Missing noexcept in string_view::find_first_of declaration cf. definition in libstdc++-v3/include/bits/string_view.tcc that does have the noexcept

Re: [PR 81248] Fix ipa-sra size check

2017-11-24 Thread Richard Biener
On November 24, 2017 5:34:17 PM GMT+01:00, Martin Jambor wrote: >Hi, > >PR 81248 is a missed-optimization bug when SRA refuses to replace a >pointer to a one-field structure to just passing the field by value. >The problem is a bogus check which compares the size of the replacement >with the size

Re: [PATCH] Missing noexcept in string_view::find_first_of declaration

2017-11-24 Thread Jonathan Wakely
On 24/11/17 18:09 +0100, Stephan Bergmann wrote: cf. definition in libstdc++-v3/include/bits/string_view.tcc that does have the noexcept (like all the other overloads defined inline in libstdc++-v3/include/std/string_view do). I thought Jason already fixed this in https://gcc.gnu.org/ml/gcc-pat

RE: [PATCH][GCC][ARM] Dot Product NEON intrinsics [Patch (3/8)]

2017-11-24 Thread Tamar Christina
Hi Christophe, > > After your commit, I have these reports: > http://people.linaro.org/~christophe.lyon/cross- > validation/gcc/trunk/255064/report-build-info.html > > After my commit, I have these reports: > http://people.linaro.org/~christophe.lyon/cross- > validation/gcc/trunk/255126/report-b

[PATCH, Makefile.in] refine selftest recipes to restore mingw bootstrap

2017-11-24 Thread Olivier Hainque
Hello, Bootstrap for mingw target configurations is failing today, with complaints about an inexistant /dev/null. The failing commands are issued by the selftest recipes in gcc/Makefile, using: SELFTEST_FLAGS = -nostdinc /dev/null -S -o /dev/null \ -fself-test=$(srcdir)/testsuite

Re: [PATCH][GCC][ARM] Dot Product NEON intrinsics [Patch (3/8)]

2017-11-24 Thread Christophe Lyon
On 24 November 2017 at 19:05, Tamar Christina wrote: > Hi Christophe, > >> >> After your commit, I have these reports: >> http://people.linaro.org/~christophe.lyon/cross- >> validation/gcc/trunk/255064/report-build-info.html >> >> After my commit, I have these reports: >> http://people.linaro.org/

[C++ PATCH] Optimize void COND_EXPRs during cp_fold (PR c++/81675)

2017-11-24 Thread Jakub Jelinek
Hi! The comment says that trying to fold VOID_TYPE_P COND_EXPRs is not worth bothering, but as the following testcase shows, that is not the case. fold_ternary can optimize COND_EXPRs where the condition is constant and the unused branch doesn't have any labels, and not folding it early means bogu

[PATCH] Fix combine's simplify_if_then_else (PR rtl-optimization/81553)

2017-11-24 Thread Jakub Jelinek
Hi! The following testcase ICEs in wide-int*, but the reason is a mode mismatch (we build a SImode MULT with one QImode argument and one VOIDmode argument, then it is folded into SImode NEG with QImode argument, ...). The bug is in assuming that the mode of c1 must be m, that is usually the case,

[committed] Avoid -Wsurprising warning on OpenMP min/max array reductions (PR fortran/81304)

2017-11-24 Thread Jakub Jelinek
Hi! gfc_trans_omp_array_reduction_or_udr creates artificial intrinsics symbol just for the purpose of expansion of array min/max reductions. That is something we certainly don't want a -Wsurprising warning on. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk

[PATCH] Fix hot/cold partitioning with -gstabs{,+} (PR debug/81307)

2017-11-24 Thread Jakub Jelinek
Hi! On most targets, N_SLINE has addresses relative to the start of the function, which means -gstabs{,+} is completely broken with hot/cold partitioning (fails to assemble almost anything that has both partitions). This used to be bearable when it wasn't the default, but now that we hot/cold par

[C++ PATCH] Avoid -Wreturn-type warnings if a switch has default label, no breaks inside of it, but is followed by a break (PR sanitizer/81275)

2017-11-24 Thread Jakub Jelinek
Hi! The testcase below has a useless break; that causes a bogus -Wreturn-type warning. The C++ FE already has code to avoid adding a BREAK_STMT after a return or similar sequence that is known not to return. The following patch extends block_may_fallthrough to also return false for SWITCH_STMTs t

[PATCH] Fix bss_initializer_p (PR target/83100)

2017-11-24 Thread Jakub Jelinek
Hi! As the testcases show, it is essential that bss_initializer_p returns true for DECL_COMMON vars without initializer, even when they are TREE_READONLY, otherwise they aren't really common, e.g. if (DECL_COMMON (decl)) { /* If the decl has been given an explicit section name, or it r

Re: [PATCH] Fix powerpc* ICE with vec builtins with -mno-altivec (PR target/82848)

2017-11-24 Thread Segher Boessenkool
Hi Jakub, On Thu, Nov 23, 2017 at 10:02:24PM +0100, Jakub Jelinek wrote: > With -mno-altivec -mno-vsx -mno-fold-gimple we error on __builtin_vec* > builtins used when corresponding ISA is not enabled. > When folding gimple, in some cases we get away with it (e.g. when folding > the builtin to PLUS

Re: [PATCH] Fix combine's simplify_if_then_else (PR rtl-optimization/81553)

2017-11-24 Thread Segher Boessenkool
Hi, On Fri, Nov 24, 2017 at 10:38:13PM +0100, Jakub Jelinek wrote: > The following testcase ICEs in wide-int*, but the reason is a mode mismatch > (we build a SImode MULT with one QImode argument and one VOIDmode argument, > then it is folded into SImode NEG with QImode argument, ...). > The bug i