Re: [PATCH] avoid calling alloca(0)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 02:27:05PM -0700, Jeff Law wrote: > I believe we should be warning on trying to allocation 0 bytes of memory via > malloc, realloc or alloca, with the exception of a non-builtin alloca with > no return value, but I think we've covered that elsewhere and Martin's code > will

Re: [PATCH] avoid calling alloca(0)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 06:15:11PM -0700, Martin Sebor wrote: > >Can't we just > >gcc_assert (x != 0) before the problematical calls? That avoids > >unnecessary over-allocation and gets us a clean ICE if we were to try > >and call alloca with a problematical value. > > gcc_assert works only in

Re: [Patch, testsuite] Fix bogus uninit-19.c failure for avr

2016-11-23 Thread Senthil Kumar Selvaraj
Jeff Law writes: > On 11/23/2016 02:54 AM, Senthil Kumar Selvaraj wrote: >> Hi, >> >> The below patch fixes uninit-19.c for avr by adding >> -finline-small-functions for avr. >> >> The test fails for avr because fn1 does not get inlined into fn2. Inlining >> occurs for x86_64 because

[tree-tailcall] Check if function returns it's argument

2016-11-23 Thread Prathamesh Kulkarni
Hi, Consider following test-case: void *f(void *a1, void *a2, __SIZE_TYPE__ a3) { __builtin_memcpy (a1, a2, a3); return a1; } return a1 can be considered equivalent to return value of memcpy, and the call could be emitted as a tail-call. gcc doesn't emit the above call to memcpy as a

Re: [patch, nios2] Fix PR78357, adjust sync builtin initialization

2016-11-23 Thread Sebastian Huber
Hello Jeff, On 23/11/16 23:28, Jeff Law wrote: On 11/16/2016 02:53 AM, Chung-Lin Tang wrote: This patch adjusts the initialization of __sync built-in functions: instead of conditionalizing on TARGET_LINUX_ABI, directly place the target-hook #define in config/nios2/linux.h. This appears to be

[PATCH] PR fortran/78279 -- convert assert to internal error

2016-11-23 Thread Steve Kargl
The patch has passed regression testing on x86_64-*-freebsd. It should be self-explanatory. OK to commit? 2016-11-23 Steven G. Kargl PR fortran/78279 * dependency.c (identical_array_ref): Convert gcc_assert to conditional and gfc_internal_error.

Re: [PATCH, rs6000] Fix PR78458, LRA ICE building libgcc for powerpc-linux-gnuspe e500v2

2016-11-23 Thread Peter Bergner
On 11/23/16 12:33 PM, Segher Boessenkool wrote: On Wed, Nov 23, 2016 at 12:13:23PM -0600, Peter Bergner wrote: Please put parens around NREGS and that last MODE. [snip] You don't need the default arguments, FWIW. Okay for trunk. Thanks! Ok, commited as revision 242818 with your

Add release notes for new TS 18661-1 macros in headers provided by GCC

2016-11-23 Thread Joseph Myers
I've applied this patch to add release notes for various new TS 18661-1 macros added to the headers GCC provides. (The GCC 7 release notes are still extremely incomplete in general, especially as regards the many diagnostic improvements in GCC 7, but probably in lots of other areas as well.)

Re: [PATCH] avoid calling alloca(0)

2016-11-23 Thread Martin Sebor
On 11/23/2016 01:57 PM, Jeff Law wrote: On 11/20/2016 04:06 PM, Martin Sebor wrote: On 11/20/2016 01:03 AM, Bernd Edlinger wrote: On 11/20/16 00:43, Martin Sebor wrote: As best I can tell the result isn't actually used (the code that uses the result gets branched over). GCC just doesn't see

Re: [PATCH] Turn on gnu-indirect-function by default on PowerPC servers

2016-11-23 Thread Joseph Myers
On Wed, 23 Nov 2016, Michael Meissner wrote: > Since some of the embedded hosts use powerpc-*-linux, I only set the > default if the target is a 64-bit PowerPC system. I tested the compiler > manually to verify that ifunc support was enabled, and it was. I did a > boostrap build/check cycle on

[PATCH] Turn on gnu-indirect-function by default on PowerPC servers

2016-11-23 Thread Michael Meissner
This patch changes the default on 64-bit PowerPC Linux systems for the --enable-gnu-indirect-function configuration option (i.e. support for the ifunc attribute) to mirror the x86_64/i386/s390x systems that assume the use of glibcs that support it. Since some of the embedded hosts use

[PATCH, rfc] combine: Make code after a new trap unreachable (PR78432)

2016-11-23 Thread Segher Boessenkool
Combine can turn a conditional trap into an unconditional trap. If it does that it should make the code after it unreachable (an unconditional trap should be the last insn in its bb, and that bb has no successors). This patch seems to work. It is hard to be sure, this is very hard to trigger.

[PATCH] PR fortran/78500 -- Yet another NULL pointer dereference

2016-11-23 Thread Steve Kargl
Regression tested on x86_64-*-freebsd. OK to commit? 2016-11-23 Steven G. Kargl PR fortran/78500 * expr.c (gfc_check_vardef_contextm): YANPD * interface.c (matching_typebound_op): Ditto. 2016-11-23 Steven G. Kargl PR

[PATCH] combine: Query can_change_dest_mode before changing dest mode

2016-11-23 Thread Segher Boessenkool
As reported in https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02388.html . Changing the mode of a hard register can lead to problems, or at least it can make worse code if the result will need reloads. Tested on avr-elf on the test in that email, and bootstrapped and regression checked on

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Eric Botcazou
> It would need strict_low_part unless we're dealing with subwords. I > think the patch should maybe check for that in the !W_R_O case. The code already does the check, it simply won't mess with strict_low_part. > Does WORD_REGISTER_OPERATIONS really buy much on targets that use it? Yes, it

Re: Add another e500 subreg pattern

2016-11-23 Thread Joseph Myers
On Wed, 23 Nov 2016, Segher Boessenkool wrote: > > --- gcc/testsuite/gcc.c-torture/compile/20161123-1.c(nonexistent) > > +++ gcc/testsuite/gcc.c-torture/compile/20161123-1.c(working copy) > > @@ -0,0 +1,7 @@ > > +double > > +f (long double x) > &

Re: Tweak LRA handling of shared spill slots

2016-11-23 Thread Jeff Law
On 11/15/2016 09:14 AM, Richard Sandiford wrote: The previous code processed the users of a stack slot in order of decreasing size and allocated the slot based on the first user. This seems a bit dangerous, since the ordering is based on the mode of the biggest reference while the allocation is

Fix sprintf buffer warning in assemble_name

2016-11-23 Thread Jeff Law
Until we sort out a reasonable API and implementation for building up label strings, this will have to be sufficient. As outlined earlier this month, when we build up label names, part of the name is hidden in the backend, part in the caller. As a result there's no good way to get the

Re: [patch, nios2] Fix PR78357, adjust sync builtin initialization

2016-11-23 Thread Jeff Law
On 11/16/2016 02:53 AM, Chung-Lin Tang wrote: This patch adjusts the initialization of __sync built-in functions: instead of conditionalizing on TARGET_LINUX_ABI, directly place the target-hook #define in config/nios2/linux.h. This appears to be in line with other similar ports, e.g. m68k.

Fix trivial spu goof

2016-11-23 Thread Jeff Law
spu.md's floatunsdidf2 pattern has an unused local variable that prevents the port from building with config-list.mk. This patch removes the unused local variable. Installing on the trunk. Jeff commit c418b1aeb420bbce4f4d767bc1adc83a6009398c Author: law

Re: PR78153

2016-11-23 Thread Rainer Orth
Hi Prathamesh, > Thanks, I committed the attached patch as r242786 after > bootstrap+test on x86_64-unknown-linux-gnu and > cross-test on arm*-*-*, aarch64*-*-*. this patch broke Ada bootstrap on Solaris. I've filed PR middle-end/78501. Rainer --

Re: [PATCH] Fix print_node for CONSTRUCTORs

2016-11-23 Thread Jeff Law
On 11/10/2016 06:08 AM, Martin Liška wrote: Hello. Following patch fixes indentation of print_node when printing a constructor that has some equal elements. Current implementation caches tree to prevent deep debug outputs. Such behavior is undesired for ctor elements. Apart from that, I switch

Re: Fix e500 offset handling for TImode

2016-11-23 Thread Segher Boessenkool
On Wed, Nov 23, 2016 at 09:16:33PM +, Joseph Myers wrote: > 2016-11-23 Joseph Myers > > * config/rs6000/rs6000.c (rs6000_legitimate_offset_address_p): For > TARGET_E500_DOUBLE. handle TDmode, TImode and PTImode the same as > TFmode, IFmode and

Re: [PATCH] docs: constify argument to __builtin_object_size()

2016-11-23 Thread Jeff Law
On 11/11/2016 06:40 AM, Jakub Kicinski wrote: It's OK to pass const pointers to __builtin_object_size(), correct the documentation. Signed-off-by: Jakub Kicinski --- gcc/doc/extend.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) THanks. Installed.

Re: Add another e500 subreg pattern

2016-11-23 Thread Segher Boessenkool
nother patch. OK to commit? > > gcc: > 2016-11-23 Joseph Myers <jos...@codesourcery.com> > > * config/rs6000/spe.md (*frob__ti_8): New insn > pattern. > > gcc/testsuite: > 2016-11-23 Joseph Myers <jos...@codesourcery.com> > > * gc

[Committed] PR fortran/78297 -- NULL pointer dereference

2016-11-23 Thread Steve Kargl
I've committed the following patch, which avoids a NULL pointer dereference. 2016-11-23 Steven G. Kargl PR fortran/78297 * trans-common.c (finish_equivalences): Do not dereference a NULL pointer. 2016-11-23 Steven G. Kargl PR

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Uros Bizjak
On Wed, Nov 23, 2016 at 8:01 PM, Bernd Schmidt wrote: > On 11/23/2016 07:57 PM, Bernd Schmidt wrote: >> >> 2. The i386 backend mishandles SET rtxs. If you have a fairly plain >> single-insn SET, you tend to get COSTS_N_INSNS (2) out of set_rtx_cost, >> because rtx_costs has a

Re: [Patch] Don't expand targetm.stack_protect_fail if it's NULL_TREE

2016-11-23 Thread Jeff Law
On 11/11/2016 11:41 AM, Jiong Wang wrote: On 24/10/16 16:22, Jeff Law wrote: Asserting couldn't hurt. I'd much rather have the compiler issue an error, ICE or somesuch than silently not generate a call to the stack protector fail routine. Hi Jeff, I have just send out the other patch

Re: [Patch] Don't expand targetm.stack_protect_fail if it's NULL_TREE

2016-11-23 Thread Jeff Law
On 10/24/2016 10:29 AM, Jiong Wang wrote: Right. But your change could mask backend problems. Specifically if their expander for stack_protect_fail did fail and returned NULL_TREE. That would cause it to silently ignore stack protector failures, which seems inadvisable. Is there another way

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
On 11/23/2016 01:30 PM, Jeff Law wrote: On 11/23/2016 01:09 PM, Martin Sebor wrote: I hadn't thought of extending the gimple-ssa-sprintf pass to all the memxxx and strxxx builtins. The _chk functions are already being handled in builtins.c so calling compute_builtin_object_size for the

Re: [PATCH] Dump probability for edges a frequency for BBs

2016-11-23 Thread Jeff Law
On 11/11/2016 06:59 AM, Martin Liška wrote: Hello. I spent quite time during this stage1 playing with predictors and we found with Honza multiple situations where a prediction was oddly calculated. Thus, we're suggesting to enhance default dump format to show BB frequencies and edge

Re: [PATCH] avoid calling alloca(0)

2016-11-23 Thread Jeff Law
On 11/18/2016 10:14 AM, Martin Sebor wrote: Most apps know what malloc (0) means and treat it correctly, they know they shouldn't dereference the pointer, because it is either NULL or holds an array with 0 elements. I fail to see why you would want to warn. Because people make mistakes and

Re: [PATCH] avoid calling alloca(0)

2016-11-23 Thread Jeff Law
On 11/18/2016 10:25 AM, Jakub Jelinek wrote: On Fri, Nov 18, 2016 at 10:14:09AM -0700, Martin Sebor wrote: Because people make mistakes and warnings help us avoid them (isn't that obvious?) Just because we get it right most of the time doesn't mean we get right all of the time. The papers and

Fix e500 offset handling for TImode

2016-11-23 Thread Joseph Myers
Given my previous fix for a missing insn pattern for e500, building glibc runs into an assembler error "Error: operand out of range (256 is not between 0 and 248)". This comes from an insn: (insn 115 1209 1210 (set (reg:DF 27 27 [orig:294 _129 ] [294]) (subreg:DF (mem/c:TI (plus:SI

Add another e500 subreg pattern

2016-11-23 Thread Joseph Myers
* config/rs6000/spe.md (*frob__ti_8): New insn pattern. gcc/testsuite: 2016-11-23 Joseph Myers <jos...@codesourcery.com> * gcc.c-torture/compile/20161123-1.c: New test. Index: gcc/config/rs6000/spe.md ===

Re: [PATCH] avoid calling alloca(0)

2016-11-23 Thread Jeff Law
On 11/20/2016 04:06 PM, Martin Sebor wrote: On 11/20/2016 01:03 AM, Bernd Edlinger wrote: On 11/20/16 00:43, Martin Sebor wrote: As best I can tell the result isn't actually used (the code that uses the result gets branched over). GCC just doesn't see it. I verified this by changing the

Re: [PATCH 8/9] Introduce class function_reader (v4)

2016-11-23 Thread David Malcolm
On Wed, 2016-11-23 at 21:15 +0100, Bernd Schmidt wrote: > On 11/11/2016 10:15 PM, David Malcolm wrote: > > > +static void > > +aarch64_test_loading_full_dump () > > +{ > > + rtl_dump_test t (SELFTEST_LOCATION, locate_file ("aarch64/times > > -two.rtl")); > > + > > + ASSERT_STREQ ("times_two",

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Jeff Law
On 11/23/2016 01:09 PM, Martin Sebor wrote: I hadn't thought of extending the gimple-ssa-sprintf pass to all the memxxx and strxxx builtins. The _chk functions are already being handled in builtins.c so calling compute_builtin_object_size for the non-checking ones there and detecting overflow

Re: [PATCH][PPC] Fix ICE using power9 with soft-float

2016-11-23 Thread Michael Meissner
On Wed, Nov 23, 2016 at 11:52:01AM +, Andrew Stubbs wrote: > On 16/11/16 17:05, Michael Meissner wrote: > >I'm starting to test this patch right now (it's on LE power8 stage3 right > >now, > >and I need to build BE power8 and BE power7 versions when I get into the > >office > >shortly, and

Re: [PATCH 1/2 v3] PR77822

2016-11-23 Thread Jeff Law
On 11/21/2016 04:03 AM, Dominik Vogt wrote: On Fri, Nov 18, 2016 at 04:29:18PM +0100, Dominik Vogt wrote: > On Fri, Nov 18, 2016 at 08:02:08AM -0600, Segher Boessenkool wrote: > > On Fri, Nov 18, 2016 at 01:09:24PM +0100, Dominik Vogt wrote: > > > IN_RANGE(POS...) makes sure that POS is a

Re: [PATCH 01/11] use rtx_insn * more places where it is obvious

2016-11-23 Thread Jeff Law
On 11/22/2016 03:10 AM, Andreas Schwab wrote: ../../gcc/config/ia64/ia64.c:7141:13: error: 'void ia64_emit_insn_before(rtx, rtx)' declared 'static' but never defined [-Werror=unused-function] static void ia64_emit_insn_before (rtx, rtx); ^ I fixed this and a

Re: [PATCH 8/9] Introduce class function_reader (v4)

2016-11-23 Thread Bernd Schmidt
On 11/11/2016 10:15 PM, David Malcolm wrote: +static void +aarch64_test_loading_full_dump () +{ + rtl_dump_test t (SELFTEST_LOCATION, locate_file ("aarch64/times-two.rtl")); + + ASSERT_STREQ ("times_two", IDENTIFIER_POINTER (DECL_NAME (cfun->decl))); + + rtx_insn *insn_1 = get_insn_by_uid

Re: [PATCH 3/9] Introduce emit_status::ensure_regno_capacity

2016-11-23 Thread Jeff Law
On 11/11/2016 02:15 PM, David Malcolm wrote: Link to earlier version of the patch: https://gcc.gnu.org/ml/gcc-patches/2016-10/msg00278.html gcc/ChangeLog: * emit-rtl.c (gen_reg_rtx): Move regno_pointer_align and regno_reg_rtx resizing logic to...

Re: [PATCH 4/9] (approved) Add some functions for use by the RTL frontend.

2016-11-23 Thread Jeff Law
On 11/11/2016 02:15 PM, David Malcolm wrote: An earlier version of this was approved by Bernd as: https://gcc.gnu.org/ml/gcc-patches/2016-10/msg00280.html and the changes since then probably fall under the "obvious" rule. gcc/ChangeLog: * read-md.c (rtx_reader::require_char): New

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
On 11/23/2016 12:47 PM, Jeff Law wrote: On 11/23/2016 12:32 PM, Martin Sebor wrote: My worry here would be a hash collision. Then we'd be using object sizes from the wrong function. Ah, right, that might explain the ICE I just noticed during Ada bootstrap. Is there some other way to

Re: [PATCH 2/9] (approved) Introduce rtl_data::init_stack_alignment

2016-11-23 Thread Jeff Law
On 11/11/2016 02:15 PM, David Malcolm wrote: (approved by Bernd) And me too :-0 Move this part of "expand"'s initialization of crtl into its own method so that it can used by the RTL frontend when postprocessing RTL dumps. gcc/ChangeLog: * cfgexpand.c (pass_expand::execute): Move

Re: [PATCH] eliminate calls to snprintf(0, 0, ...) with known return value (pr78476)

2016-11-23 Thread Jeff Law
On 11/22/2016 08:02 PM, Martin Sebor wrote: Calls to bounded functions like snprintf with a zero-size buffer are special requests to compute the size of output without actually writing any. For example: int n = snprintf(0, 0, "%08x", rand ()); is a request to compute the number of bytes

Re: [PATCH] Fix up testcase (PR tree-optimization/78482)

2016-11-23 Thread Jeff Law
On 11/23/2016 12:36 PM, Jakub Jelinek wrote: Hi! The testcase uses char and can't work properly with unsigned char (otherwise c >= 0 is always true). In addition to that I've noticed that the testcase as is actually doesn't fail with the unfixed gcc, it will just print 2 on stdout. The

[PATCH, i386]: Fix *hi_1 operand 2 constraints.

2016-11-23 Thread Uros Bizjak
De-macroization artefact. 2016-11-23 Uros Bizjak * config/i386/i386.md (*hi_1): Fix operand 2 constraints. Bootstrapped, regression test on x86_64-linux-gnu {,-m32} in process. Will commit to mainline and release branches ASAP. Uros. Index: config/i386/i386.md

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Jeff Law
On 11/23/2016 12:32 PM, Martin Sebor wrote: My worry here would be a hash collision. Then we'd be using object sizes from the wrong function. Ah, right, that might explain the ICE I just noticed during Ada bootstrap. Is there some other way to uniquely identify a function? A DECL_UID maybe?

Re: [3/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Uros Bizjak
> 3. ifcvt computes the sum of costs for the involved blocks, but only > makes a before/after comparison when optimizing for size. When > optimizing for speed, it uses max_seq_cost, which is an estimate > computed from BRANCH_COST, which in turn can be zero for predictable > branches on x86. Can

Re: [PATCH] Fix up -fsanitize=undefined (PR sanitizer/69278)

2016-11-23 Thread Richard Biener
On November 23, 2016 8:33:54 PM GMT+01:00, Jakub Jelinek wrote: >Hi! > >As mentioned in the PR, the r240491 change broke -fsanitize=undefined, >which no longer enables -fsanitize=unreachable or -fsanitize=return. >That is undesirable change, we only want not to enable

Re: [PATCH] Fix up testcase (PR tree-optimization/78482)

2016-11-23 Thread Richard Biener
On November 23, 2016 8:36:11 PM GMT+01:00, Jakub Jelinek wrote: >Hi! > >The testcase uses char and can't work properly with unsigned char >(otherwise >c >= 0 is always true). > >In addition to that I've noticed that the testcase as is actually >doesn't >fail with the unfixed

Re: [3/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Jeff Law
On 11/23/2016 12:02 PM, Bernd Schmidt wrote: On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 3. ifcvt computes the sum of costs for the involved blocks, but only makes a before/after comparison when optimizing for size. When optimizing for speed, it uses max_seq_cost, which is an estimate computed

[PATCH] Fix up testcase (PR tree-optimization/78482)

2016-11-23 Thread Jakub Jelinek
Hi! The testcase uses char and can't work properly with unsigned char (otherwise c >= 0 is always true). In addition to that I've noticed that the testcase as is actually doesn't fail with the unfixed gcc, it will just print 2 on stdout. The following has been tested on x86_64-linux and

[PATCH] Fix up -fsanitize=undefined (PR sanitizer/69278)

2016-11-23 Thread Jakub Jelinek
Hi! As mentioned in the PR, the r240491 change broke -fsanitize=undefined, which no longer enables -fsanitize=unreachable or -fsanitize=return. That is undesirable change, we only want not to enable -fsanitize-recover=unreachable,return on -fsanitize-recover=undefined. Fixed thusly,

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
On 11/23/2016 12:10 PM, Jeff Law wrote: On 11/23/2016 11:26 AM, Martin Sebor wrote: My only real concern here is that if we call compute_builtin_object_size without having initialized the passes, then we initialize, compute, then finalize. Subsequent calls will go through the same process --

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 08:30 PM, Jeff Law wrote: On 11/23/2016 12:00 PM, Bernd Schmidt wrote: Note that I misspelled the PR number in the 0/3 message :-/ On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 1. I noticed comparisons between set_src_cost and set_rtx_cost seemed to be invalid. There seems to be

[committed] Fix OpenMP ICE with private allocatable on orphaned worksharing construct (PR middle-end/69183)

2016-11-23 Thread Jakub Jelinek
Hi! allocatable privatized vars need access to the outer var for sizing, but unlike e.g. firstprivate the standard allows them on orphaned worksharing constructs or when the var is already private outside of the worksharing construct. Therefore, we should treat it similarly to outer refs on simd

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Jeff Law
On 11/23/2016 12:00 PM, Bernd Schmidt wrote: Note that I misspelled the PR number in the 0/3 message :-/ On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 1. I noticed comparisons between set_src_cost and set_rtx_cost seemed to be invalid. There seems to be no good reason that insn_rtx_cost

Re: [PATCH, i386]: Improve mask op patterns a bit

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 08:09:01PM +0100, Uros Bizjak wrote: > Hello! > > This patch cleans and improves mask op patterns a bit. The patch uses > insn mode attribute to control emission of word-mode operations and > macroizes a couple of patterns. > > No functional changes. > > 2016-11-23 Uros

Re: [Patch, testsuite] Fix bogus uninit-19.c failure for avr

2016-11-23 Thread Jeff Law
On 11/23/2016 02:54 AM, Senthil Kumar Selvaraj wrote: Hi, The below patch fixes uninit-19.c for avr by adding -finline-small-functions for avr. The test fails for avr because fn1 does not get inlined into fn2. Inlining occurs for x86_64 because fn1's computed size equals

Re: [PATCH, GCC] Improve comment for struct symbolic_number in bswap pass

2016-11-23 Thread Jeff Law
On 11/23/2016 03:45 AM, Thomas Preudhomme wrote: Hi, The current comment for struct symbolic_number in the bswap pass code (tree-ssa-math-opts.c) does not explain all of the fields in the structure. It is also a bit unclear at times. This patch rewrites the comment to fix those. Note: it

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Jeff Law
On 11/23/2016 11:26 AM, Martin Sebor wrote: My only real concern here is that if we call compute_builtin_object_size without having initialized the passes, then we initialize, compute, then finalize. Subsequent calls will go through the same process -- the key being each one re-computes the

[PATCH, i386]: Improve mask op patterns a bit

2016-11-23 Thread Uros Bizjak
Hello! This patch cleans and improves mask op patterns a bit. The patch uses insn mode attribute to control emission of word-mode operations and macroizes a couple of patterns. No functional changes. 2016-11-23 Uros Bizjak * gcc.target/config/i386.md

[3/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 3. ifcvt computes the sum of costs for the involved blocks, but only makes a before/after comparison when optimizing for size. When optimizing for speed, it uses max_seq_cost, which is an estimate computed from BRANCH_COST, which in turn can be zero

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 2. The i386 backend mishandles SET rtxs. If you have a fairly plain single-insn SET, you tend to get COSTS_N_INSNS (2) out of set_rtx_cost, because rtx_costs has a default of COSTS_N_INSNS (1) for a SET, and you get the cost of the src in addition to

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
Note that I misspelled the PR number in the 0/3 message :-/ On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 1. I noticed comparisons between set_src_cost and set_rtx_cost seemed to be invalid. There seems to be no good reason that insn_rtx_cost shouldn't use the latter. It also makes the numbers

[0/3] Fix PR71280, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
This is a small series of patches to fix various problems in cost calculations that together caused PR71280, a missed optimization opportunity. A summary of the problems: 1. I noticed comparisons between set_src_cost and set_rtx_cost seemed to be invalid. There seems to be no good reason

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Jeff Law
On 11/23/2016 03:32 AM, Paolo Bonzini wrote: On 23/11/2016 11:26, Eric Botcazou wrote: Does it really do that with a (set (reg1:QI)), as opposed to a (set (strict_low_part (subreg:QI (reg1:DI)))? That's the question (note that REE runs after register allocation). IIRC, strict_low_part is

Re: Set mode of decimal floats before calling layout_type

2016-11-23 Thread Jeff Law
On 11/23/2016 07:45 AM, Richard Sandiford wrote: Previously decimal floating-point types were created and laid out as binary floating-point types, then the caller changed the mode to a decimal mode later. The problem with that approach is that not all targets support an equivalent binary

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Segher Boessenkool
On Wed, Nov 23, 2016 at 05:53:43PM +0100, Georg-Johann Lay wrote: > >So why does the define_insn allow it? > > Because the insn predicate is register_operand:HI which should be fine > as it is non-strict RTL. Or are predicates supposed to reject such odd > operands the backend would never

Re: [PATCH, rs6000] Fix PR78458, LRA ICE building libgcc for powerpc-linux-gnuspe e500v2

2016-11-23 Thread Joseph Myers
On Wed, 23 Nov 2016, Peter Bergner wrote: > Joseph, I copied the testsuite preamble from another SPE test case. > Does it look correct to you to catch the bug? I think the preamble is fine. I'm running execution testing with my two SPE patches and will submit them if results seem reasonable

Re: [Aarch64][PATCH] Improve Logical And Immediate Expressions

2016-11-23 Thread Christophe Lyon
On 23 November 2016 at 17:30, Michael Collison wrote: > Hi Christophe, > > This is not a regression per se; the patch causes the test case to generate > one less instruction overall, but one additional 'and'. Trunk before the > patch (-O2): > > foo: > and

Re: [PATCH, rs6000] Fix PR78458, LRA ICE building libgcc for powerpc-linux-gnuspe e500v2

2016-11-23 Thread Segher Boessenkool
On Wed, Nov 23, 2016 at 12:13:23PM -0600, Peter Bergner wrote: > --- gcc/config/rs6000/rs6000.h(revision 241976) > +++ gcc/config/rs6000/rs6000.h(working copy) > @@ -1279,9 +1279,11 @@ enum data_align { align_abi, align_opt, > enough space to account for vectors in FP regs.

Re: [PATCH] Fix PR bootstrap/78493

2016-11-23 Thread Jeff Law
On 11/23/2016 09:13 AM, Martin Liška wrote: Hello. As described in the PR, the patch fixes profiled bootstrap on x86_64-linux-gnu. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. And profiled bootstrap on x86_64-linux-gnu finishes successfully. Ready to be

Re: [PATCH] enable -Wformat-length for dynamically allocated buffers (pr 78245)

2016-11-23 Thread Martin Sebor
My only real concern here is that if we call compute_builtin_object_size without having initialized the passes, then we initialize, compute, then finalize. Subsequent calls will go through the same process -- the key being each one re-computes the internal state which might get expensive.

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Jeff Law
On 11/23/2016 09:53 AM, Georg-Johann Lay wrote: Segher Boessenkool schrieb: On Wed, Nov 23, 2016 at 04:58:22PM +0100, Georg-Johann Lay wrote: Hi, this causes an illegal code issue on avr. Sorry about that. [ snip ] Trying 19 -> 7: Failed to match this instruction: (set (reg:HI 45 [ x+3 ])

Re: Tighten check for whether a sibcall references local variables

2016-11-23 Thread Jeff Law
On 11/23/2016 10:09 AM, Richard Sandiford wrote: Richard Biener writes: On Tue, Nov 22, 2016 at 10:00 AM, Richard Sandiford wrote: This loop: /* Make sure the tail invocation of this function does not refer to local variables.

Re: [Patch 16/17 libgcc ARM] Half to double precision conversions

2016-11-23 Thread James Greenhalgh
On Wed, Nov 16, 2016 at 04:00:12PM +, Kyrill Tkachov wrote: > <...> > > diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md > index 8393f65..4074773 100644 > --- a/gcc/config/arm/arm.md > +++ b/gcc/config/arm/arm.md > @@ -5177,20 +5177,35 @@ >"" > ) > -;; DFmode to HFmode

Re: [Patch 14/17] [libgcc, ARM] Generalise float-to-half conversion function.

2016-11-23 Thread James Greenhalgh
On Wed, Nov 16, 2016 at 04:38:17PM +, Kyrill Tkachov wrote: > Hi James, > diff --git a/libgcc/config/arm/fp16.c b/libgcc/config/arm/fp16.c > index 39c863c..ba89796 100644 > --- a/libgcc/config/arm/fp16.c > +++ b/libgcc/config/arm/fp16.c > @@ -22,40 +22,74 @@ > see the files COPYING3 and

Re: [C++ PATCH] Fix wrong-code on var construction in static init (PR c++/77907)

2016-11-23 Thread Jason Merrill
On Wed, Nov 23, 2016 at 11:36 AM, Jakub Jelinek wrote: > On Wed, Nov 23, 2016 at 10:42:57AM -0500, Jason Merrill wrote: >> OK, but I wonder why we don't do constant initialization of that variable... > > Dunno either, check_initializer simply returns the call to the constructor

And fix the mcore port too

2016-11-23 Thread Jeff Law
Another prototype that didn't get fixed in the rtx_insn * changes. Installing on the trunk as obvious. Jeff commit 9fb780b14647e3c0d4232029b9f1b7d6de6103d6 Author: Jeff Law Date: Wed Nov 23 11:15:03 2016 -0700 * config/mcore/mcore.c (emit_new_cond_insn): Fix

[PATCH, rs6000] Fix PR78458, LRA ICE building libgcc for powerpc-linux-gnuspe e500v2

2016-11-23 Thread Peter Bergner
PR78458 shows a problem in LRA spilling caused by HARD_REGNO_CALLER_SAVE_MODE() returning a bogus mode (IFmode). This patch solves the problem by just returning MODE if MODE is wide enough to save and restore NREGS itself. This patch passed bootstrap and regtesting on powerpc64le-linux as well

Fix iq2000 builds

2016-11-23 Thread Jeff Law
The XXX in boolean context warning is now triggering on a bit of code in the iq2000 backend. I'm trying to guess Stan's intent from 2003. If I've got it wrong, the worst that happens in an incorrect cost computation. Installing on the trunk. Jeff commit

Re: PR78153

2016-11-23 Thread Prathamesh Kulkarni
On 23 November 2016 at 17:51, Richard Biener wrote: > On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: > >> On 23 November 2016 at 17:21, Richard Biener wrote: >> > On Wed, 23 Nov 2016, Prathamesh Kulkarni wrote: >> > >> >> On 23 November 2016 at 15:16,

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Jeff Law
On 11/23/2016 05:26 AM, Bernd Schmidt wrote: On 11/23/2016 11:18 AM, Paolo Bonzini wrote: On 23/11/2016 10:35, Eric Botcazou wrote: I now wonder whether this also matters for !WORD_REGISTER_OPERATIONS targets, e.g. x86: (set (reg1:DI) ... ... (set (reg1:QI)

Fix ia64 builds

2016-11-23 Thread Jeff Law
The recent rtx_insn * changes mucked up ia64 in a trivial way. The definition of ia64_emit_insn_before was changed, but not the prototype. This results in a build error. Fixed in the obvious way. Applying to the trunk. Jeff commit f491be0d30b8e0063e54972497b8e049482f03b8 Author: law

Re: [PATCH] Fix PR71762

2016-11-23 Thread Richard Biener
On November 23, 2016 6:25:43 PM GMT+01:00, Bernd Schmidt wrote: >On 11/10/2016 02:28 PM, Richard Biener wrote: >> Any takers for the RTL implementation? > >Do you have a testcase you think can be optimized? The forwrop test case I XFAILed with the patch. Richard. > >Bernd

Re: [PATCH] Add map clauses to libgomp test device-3.f90

2016-11-23 Thread Jakub Jelinek
On Tue, Nov 15, 2016 at 08:01:32PM +0300, Alexander Monakov wrote: > On Tue, 15 Nov 2016, Alexander Monakov wrote: > > Yep, I do see new test execution failures with both Intel MIC and PTX > > offloading > > on device-1.f90, device-3.f90 and target2.f90. Here's an actually-tested > > patch > >

Re: [PATCH] Fix PR71762

2016-11-23 Thread Bernd Schmidt
On 11/10/2016 02:28 PM, Richard Biener wrote: Any takers for the RTL implementation? Do you have a testcase you think can be optimized? Bernd

Re: Tighten check for whether a sibcall references local variables

2016-11-23 Thread Richard Sandiford
Richard Biener writes: > On Tue, Nov 22, 2016 at 10:00 AM, Richard Sandiford > wrote: >> This loop: >> >> /* Make sure the tail invocation of this function does not refer >> to local variables. */ >> FOR_EACH_LOCAL_DECL (cfun, idx,

Re: [Patch v4 0/17] Add support for _Float16 to AArch64 and ARM

2016-11-23 Thread James Greenhalgh
On Mon, Nov 21, 2016 at 09:19:35AM +, Kyrill Tkachov wrote: > > On 18/11/16 18:19, James Greenhalgh wrote: > >On Fri, Nov 11, 2016 at 03:37:17PM +, James Greenhalgh wrote: > >>Hi, > >> > >>This patch set enables the _Float16 type specified in ISO/IEC TS 18661-3 > >>for AArch64 and ARM.

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Georg-Johann Lay
Segher Boessenkool schrieb: On Wed, Nov 23, 2016 at 04:58:22PM +0100, Georg-Johann Lay wrote: Hi, this causes an illegal code issue on avr. Sorry about that. [ snip ] Trying 19 -> 7: Failed to match this instruction: (set (reg:HI 45 [ x+3 ]) (zero_extend:HI (reg:QI 25 r25 [ x+3 ])))

Re: [C++ PATCH] Fix wrong-code on var construction in static init (PR c++/77907)

2016-11-23 Thread Jakub Jelinek
On Wed, Nov 23, 2016 at 10:42:57AM -0500, Jason Merrill wrote: > OK, but I wonder why we don't do constant initialization of that variable... Dunno either, check_initializer simply returns the call to the constructor for the var. I've tried something like: --- gcc/cp/decl.c.jj2016-11-21

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Segher Boessenkool
On Wed, Nov 23, 2016 at 04:58:22PM +0100, Georg-Johann Lay wrote: > Hi, this causes an illegal code issue on avr. Sorry about that. [ snip ] > Trying 19 -> 7: > Failed to match this instruction: > (set (reg:HI 45 [ x+3 ]) > (zero_extend:HI (reg:QI 25 r25 [ x+3 ]))) > Successfully matched

RE: [Aarch64][PATCH] Improve Logical And Immediate Expressions

2016-11-23 Thread Michael Collison
Hi Christophe, This is not a regression per se; the patch causes the test case to generate one less instruction overall, but one additional 'and'. Trunk before the patch (-O2): foo: and w0, w0, 255 lsl w1, w0, 20 orr w0, w1, w0, lsl 8 mov w1,

[PATCH] Fix PR bootstrap/78493

2016-11-23 Thread Martin Liška
Hello. As described in the PR, the patch fixes profiled bootstrap on x86_64-linux-gnu. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. And profiled bootstrap on x86_64-linux-gnu finishes successfully. Ready to be installed? Martin >From

Re: [PATCH] combine: Convert subreg-of-lshiftrt to zero_extract properly (PR78390)

2016-11-23 Thread Michael Matz
Hi, On Wed, 23 Nov 2016, Segher Boessenkool wrote: > > Even with non-constant shifts it remains an extract and make_extraction > > does support variable start positions (which is the shift amount), as does > > the zero_extract pattern (depending on target of course). > > Sure, but the

Re: [PATCH] combine: Improve change_zero_ext (fixes PR71847)

2016-11-23 Thread Georg-Johann Lay
Hi, this causes an illegal code issue on avr. Test case (reduced from gcc.dg/builtins-32.c): extern int signbitf (float); int test (float x) { return signbitf (x); } Before combine, the dump reads (note 4 0 19 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (insn 19 4 3 2 (set (reg:QI 51 [ x+3 ])

  1   2   >