[PATCH 1/3] S/390: Rework shift count handling.

2019-07-07 Thread Robin Dapp
Add s390_valid_shift_count to determine the validity of a shift-count operand. This is used to replace increasingly complex substitutions that should have allowed address-style shift-count handling, an and mask as well as no-op subregs on the operand. -- gcc/ChangeLog: 2019-07-05 Robin Dapp

[PATCH 3/3] S/390: Define shift_truncation_mask.

2019-07-07 Thread Robin Dapp
Define s390_shift_truncation_mask to allow the optabs optimization sh = (64 - sh) -> sh = -sh for a rotation operation. -- gcc/ChangeLog: 2019-07-05 Robin Dapp * config/s390/s390.c (s390_shift_truncation_mask): Define. (TARGET_SHIFT_TRUNCATION_MASK): Define. gcc/tests

[PATCH 2/3] S/390: Shift count tests.

2019-07-07 Thread Robin Dapp
Tests to check for the changed shift-count handling. -- gcc/testsuite/ChangeLog: 2019-07-05 Robin Dapp * gcc.target/s390/combine-rotate-modulo.c: New test. * gcc.target/s390/combine-shift-rotate-add-mod.c: New test. * gcc.target/s390/vector/combine-shift-vec.c: New te

[PATCH 0/3] S/390: Shift count improvements.

2019-07-07 Thread Robin Dapp
Hi, these patches introduce a new predicate that recognizes shift-count operands instead of the subst patterns we used before. This allows introducing (no-op) subregs in the patterns which was not possible via subst before (see https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00853.html). The second

Re: [PATCH, RISC-V] Fix ambiguous mode of some compare insn

2019-07-07 Thread Jim Wilson
On Sat, Jul 6, 2019 at 1:26 AM Katsuhiro Suzuki wrote: > This patch fixes ambiguous mode of some compare insns of RISC-V. > Only sge, slt and sle are using but other compare insns use > . It seems first group mode settings are ambiguous. Richard Sandiford submitted a patch that fixes every port,

Re: [07/11] [riscv] Fix ambiguous .md attribute uses

2019-07-07 Thread Jim Wilson
On Fri, Jul 5, 2019 at 11:19 PM Richard Sandiford wrote: > gcc/ > * config/riscv/pic.md (*local_pic_load_s) > (*local_pic_load_u): Explicitly specify the mode iterator > referenced by , giving... > (*local_pic_load_s, *local_pic_load_u): > ...these. > * con

[patch, libfortran] Adjust block size for libgfortran for unformatted reads

2019-07-07 Thread Thomas Koenig
Hello world, the attached patch sets the I/O block size for unformatted files to 2**17 and makes this, and the block size for formatted files, adjustable via environment variables. The main reason is that -fconvert=big-endian was quite slow on some HPC systems. A bigger buffer should eliminate t

Re: Prevent tree-ssa-dce.c from deleting stores at -Og

2019-07-07 Thread Jeff Law
On 7/7/19 3:45 AM, Richard Sandiford wrote: > DCE tries to delete dead stores to local data and also tries to insert > debug binds for simple cases: > > /* If this is a store into a variable that is being optimized away, > add a debug bind stmt if possible. */ > if (MAY_HAVE_DEBUG_BIND_S

Re: Prevent -Og from deleting stores to write-only variables

2019-07-07 Thread Jakub Jelinek
On Sun, Jul 07, 2019 at 10:41:43AM +0100, Richard Sandiford wrote: > gcc/testsuite/ > * c-c++-common/guality/Og-static-wo-1.c: New test. > * g++.dg/guality/guality.exp: Separate the c-c++-common tests into > "Og" and "general" tests. Run the latter at -O0 and -Og only. Do we rea

Re: Don't run DSE at -Og

2019-07-07 Thread Jeff Law
On 7/7/19 3:43 AM, Richard Sandiford wrote: > This patch stops gimple and rtl DSE from running by default at -Og. > The idea is both to improve compile time and to stop us from deleting > stores that we can't track in debug info. > > We could rein this back in future for stores to local variables

Re: Prevent -Og from deleting stores to write-only variables

2019-07-07 Thread Jeff Law
On 7/7/19 3:41 AM, Richard Sandiford wrote: > This patch prevents -Og from deleting stores to write-only variables, > so that the values are still available when debugging. This seems > more convenient than forcing users to use __attribute__((used)) > (probably conditionally, if it's not something

Re: Add a build config for bootstrapping at -Og

2019-07-07 Thread Jeff Law
On 7/7/19 3:40 AM, Richard Sandiford wrote: > Although BOOT_CFLAGS can be used to bootstrap with -Og, having a > dedicated build config is sometimes more convenient. > > Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? > > Richard > > > 2019-07-07 Richard Sandiford > > conf

Re: Make guality.h handle Yama restricted ptrace mode

2019-07-07 Thread Jeff Law
On 7/7/19 3:39 AM, Richard Sandiford wrote: > guality.exp is silently skipped on Linux systems with > kernel.yama.ptrace_scope=1 because gdb fails to attach to the > sanity check test. This patch uses PR_SET_PTRACER (where available) > to avoid this. > > prctl was apparently added in Linux 2.1.57

[committed] [PR tree-optimization/91090] Fix logic error in jump threading

2019-07-07 Thread Jeff Law
This code was copied and reindented from tree-vrp.c. It looks like in that process the second conditional moved inside the true arm of the first conditional, which was wrong. It won't cause incorrect code, just missed optimizations. I also verified that the code is still live -- it triggers dur

[PATCH] subreg: Add -fsplit-wide-types-early (PR88233)

2019-07-07 Thread Segher Boessenkool
Currently the second lower-subreg pass is run right before RA. This is much too late to be very useful. At least for targets that do not have RTL patterns for operations on multi-register modes it is a lot better to split patterns earlier, before combine and all related passes. This adds an opti

[Darwin] Make a final check on PIC options.

2019-07-07 Thread Iain Sandoe
In some cases the cascaded settings for pic/pie/PIC/PIE can cause a confusing scenario for Darwin where "fPIC fno-PIE” produces a wrong code generation setting. So we make a final check on PIC options; for Darwin these are not dependent on the PIE ones, although PIE does require PIC to support i

[Darwin] Don't jam symbol stubs on for kernel code.

2019-07-07 Thread Iain Sandoe
For PPC Darwin, we need the JBSR long jump code to be enabled when generating kernel code. Now we have that handled in rs6000.c, we can drop the conflated setting in the common code. The gcc-4.2.1 compilers don’t generate symbol stubs for any X86 case. tested on x86_64-darwin16, applied to mainl

[PATCH] rs6000: Delete Ffre

2019-07-07 Thread Segher Boessenkool
It is unused. Committing. 2019-07-07 Segher Boessenkool * config/rs6000/rs6000.md (Ffre): Delete. --- gcc/config/rs6000/rs6000.md | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 9e81df9..3cc42cb6 100644 --- a/gcc/co

Re: [Patch, fortran] PR91077 - [8/9/10 Regression] Wrong indexing when using a pointer

2019-07-07 Thread Paul Richard Thomas
Thanks, Steve. Fixed with revisions 273176, 7 & 8. Paul On Sat, 6 Jul 2019 at 18:05, Steve Kargl wrote: > > On Sat, Jul 06, 2019 at 02:29:06PM +0100, Paul Richard Thomas wrote: > > As anticipated, 8-branch required a different patch but the difference > > was much smaller than anticipated. > >

[RFC][PR89245] Check REG_CALL_DECL note during the tail-merging

2019-07-07 Thread Dragan Mladjenovic
From: "Dragan Mladjenovic" This patch prevents merging of CALL instructions that that have different REG_CALL_DECL notes attached to them. On most architectures this is not an important distinction. Usually instruction patterns for calls to different functions reference different SYMBOL_REF-s,

Prevent tree-ssa-dce.c from deleting stores at -Og

2019-07-07 Thread Richard Sandiford
DCE tries to delete dead stores to local data and also tries to insert debug binds for simple cases: /* If this is a store into a variable that is being optimized away, add a debug bind stmt if possible. */ if (MAY_HAVE_DEBUG_BIND_STMTS && gimple_assign_single_p (stmt) && is_

Don't run DSE at -Og

2019-07-07 Thread Richard Sandiford
This patch stops gimple and rtl DSE from running by default at -Og. The idea is both to improve compile time and to stop us from deleting stores that we can't track in debug info. We could rein this back in future for stores to local variables with is_gimple_reg_type, but at the moment we don't ha

Prevent -Og from deleting stores to write-only variables

2019-07-07 Thread Richard Sandiford
This patch prevents -Og from deleting stores to write-only variables, so that the values are still available when debugging. This seems more convenient than forcing users to use __attribute__((used)) (probably conditionally, if it's not something they want in release builds). Tested on aarch64-li

Add a build config for bootstrapping at -Og

2019-07-07 Thread Richard Sandiford
Although BOOT_CFLAGS can be used to bootstrap with -Og, having a dedicated build config is sometimes more convenient. Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard 2019-07-07 Richard Sandiford config/ * bootstrap-Og.mk: New file. gcc/ * doc/insta

Make guality.h handle Yama restricted ptrace mode

2019-07-07 Thread Richard Sandiford
guality.exp is silently skipped on Linux systems with kernel.yama.ptrace_scope=1 because gdb fails to attach to the sanity check test. This patch uses PR_SET_PTRACER (where available) to avoid this. prctl was apparently added in Linux 2.1.57, so I don't think we need any tests other than __linux