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. How

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 w0, w0, 255 > lsl

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 (si

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 gener

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 floatin

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 r

[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 that

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 co

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 t

[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 fo

[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 (*movqi_internal): Calculate mode

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 inte

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 depends

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 call_stmt_size.

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: [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 shouldn'

[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 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 n

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 -- th

[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, bootstrapped/

[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 i686-lin

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

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 gcc, it will just pri

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 >-fsanitize-recover=unreacha

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 y

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?

[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] 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 followi

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 that

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 sta

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 uniquel

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 metho

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... (emit_status::ensure_re

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 (1)

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 si

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 non-

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 bu

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 i

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", ID

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 XALLOC

Add another e500 subreg pattern

2016-11-23 Thread Joseph Myers
md (*frob__ti_8): New insn pattern. gcc/testsuite: 2016-11-23 Joseph Myers * gcc.c-torture/compile/20161123-1.c: New test. Index: gcc/config/rs6000/spe.md === --- gcc/config/rs6000/spe.md(revision 242751) ++

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 (reg/f

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

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 wa

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 probabilitie

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 non-che

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] 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 whic

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 default of COSTS_N_IN

[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 fortran/78297 * gfortran.dg/pr

Re: Add another e500 subreg pattern

2016-11-23 Thread Segher Boessenkool
nother patch. OK to commit? > > gcc: > 2016-11-23 Joseph Myers > > * config/rs6000/spe.md (*frob__ti_8): New insn > pattern. > > gcc/testsuite: > 2016-11-23 Joseph Myers > > * gcc.c-torture/compile/20161123-1.c: New test. Okay, thanks

Re: [RFA] Fix various PPC build failures due to int-in-boolean-context code

2016-11-23 Thread Jeff Law
On 11/07/2016 08:15 AM, Bernd Edlinger wrote: On Fri, Oct 28, 2016 at 09:12:29AM -0600, Jeff Law wrote: > > The PPC port is stumbling over the new integer in boolean context warnings. > > In particular this code from rs6000_option_override_internal is > problematical: > > HOST_WIDE_I

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. jeff

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 KFmode. This is fine. Thank

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 t

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 -- --

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 Date: Wed Nov 23 22:17:29 2016 +000

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. Seba

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 leng

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 b

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: [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 make

[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 powerpc6

[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 fortran/78500 * gfortran.dg/pr7

[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. Q

[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 powerpc-*-li

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 a

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 i

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.) I

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 suggestions.

[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. 2016-11-23 Steven G.

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 i

[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 tail-cal

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 fn1'

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 so

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

<    1   2