[PATCH] Prevent extract_muldiv from introducing an overflow (PR sanitizer/80800)

2017-05-18 Thread Marek Polacek
extract_muldiv folds (n * 1 * z) * 50 to (n * 50) * z which is a wrong transformation to do, because it may introduce an overflow. This resulted in a ubsan false positive. So we should just disable this folding altogether. Does the approach I took make sense? Bootstrapped/regtes

[PATCH 2/2] [testsuite] PR 80759 Remove gas extensions from do-test.S, fix other problems

2017-05-18 Thread Daniel Santos
Use of .struct in do_test.S causes breakages when gas isn't the assembler (e.g., Solaris). I also wasn't including TEST_ALWAYS_FLAGS in my CFLAGS resulting in super-ugly log files. Finally, this patch eliminates spam of "test unsupported" (limiting it to one printing). Signed-off-by: Daniel Sant

[PATCH 1/2] [testsuite] Move non-standard parallelization support into new lib and fix flaw

2017-05-18 Thread Daniel Santos
This fixes a flaw in my parallelization code that caused it to fail when GCC_RUNTEST_PARALLELIZE_DIR wasn't set. It worked fine with make -j1, but failed with just make. As there could be other tests that might need to do their own paralellization, I'm moving the that code into it's own file unde

[PATCH 0/2] [testsuite] PR80759 Fix test breakages on i386-pc-solaris2.*

2017-05-18 Thread Daniel Santos
There are a few issues with my ms-sysv.exp tests: 1. Use of gas extensions in do_test.S cause breakages on Solaris, 2. Parallelization breaks when no make -j flag is passed, 3. Builds aren't adding TEST_ALWAYS_FLAGS, so log files filled with color escape codes, and 4. The "test unsupported" me

[PATCH][Aarch64] Add support for overflow add and sub operations

2017-05-18 Thread Michael Collison
Hi, This patch improves code generations for builtin arithmetic overflow operations for the aarch64 backend. As an example for a simple test case such as: Sure for a simple test case such as: int f (int x, int y, int *ovf) { int res; *ovf = __builtin_sadd_overflow (x, y, &res); return res

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-18 Thread Daniel Santos
PS: Oh! it might be due to the difference between -j1 and no -j argument. Yes, that's how I missed it. This flaw isn't exposed with make -j1, but is exposed with just make. Thanks for finding this! Daniel

Re: [PATCH] [MSP430] PR78838: Do not add section name prefixes when section name is .lowtext

2017-05-18 Thread Martin Sebor
On 05/18/2017 10:14 AM, Jozef Lawrynowicz wrote: A patch for this bug was originally posted here: https://gcc.gnu.org/ml/gcc-patches/2017-02/msg01054.html There were some issues with that patch which I've now fixed. The MSP430 target supports the automatic placement of functions and data in diff

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-18 Thread Daniel Santos
On 05/18/2017 08:37 AM, Bernd Edlinger wrote: On 05/17/17 04:01, Daniel Santos wrote: - if (ignore_outlined && cfun->machine->call_ms2sysv - && in_hard_reg_set_p (stub_managed_regs, DImode, regno)) -return false; + if (ignore_outlined && cfun->machine->call_ms2sysv) +{ + /* R

Re: RFA: PATCH to add id_strcmp helper function

2017-05-18 Thread Martin Sebor
On 05/18/2017 08:30 PM, Jason Merrill wrote: I got tired of writing strcmp (IDENTIFIER_POINTER and decided to wrap it in an inline function. I decided to use "id_strcmp" instead of just overloading strcmp, but I don't feel strongly about that choice. The second patch changes all existing uses o

RFA: PATCH to check for overflow in make_tree_vec_stat

2017-05-18 Thread Jason Merrill
A patch I've been putting together ran into strange memory corruption issues which turned out to be because the calculation in make_tree_vec_stat was overflowing and allocating a small TREE_VEC instead of a large one. This assert should work as a simple sanity check. Tested x86_64-pc-linux-gnu, O

RFA: PATCH to add id_strcmp helper function

2017-05-18 Thread Jason Merrill
I got tired of writing strcmp (IDENTIFIER_POINTER and decided to wrap it in an inline function. I decided to use "id_strcmp" instead of just overloading strcmp, but I don't feel strongly about that choice. The second patch changes all existing uses of that pattern to use the new function. OK for

Re: [patch, fortran] PR80333 Namelist dtio write of array of class does not traverse the array

2017-05-18 Thread Steve Kargl
On Thu, May 18, 2017 at 05:16:45PM -0700, Jerry DeLisle wrote: > > 2017-05-18 Paul Thomas > > PR fortran/80333 > * trans-io.c (nml_get_addr_expr): If we are dealing with class > type data set tmp tree to get that address. > (transfer_namelist_element): Set the array spe

[patch, fortran] PR80333 Namelist dtio write of array of class does not traverse the array

2017-05-18 Thread Jerry DeLisle
Hello, With some important help from Paul regarding how to access the class data and array specs, we have the attached patch. This fixes both READ and WRITE of arrays of class/type objects. The namelist routines are updated to set the array specifications correctly in the frontend so that t

Re: [PATCH] Try harder to fix recently introduced crashes in ggc_collect

2017-05-18 Thread Nathan Sidwell
On 05/18/2017 04:40 PM, Bernd Edlinger wrote: Hi, unfortunately the first patch was still insufficient. I identified many more relatively new places where static tree objects are invisible to GC. Hm, I didn't think the fns in except.c etc needed to be GTY'd because they'd still be reachable

[PATCH] [Aarch64] Variable shift count truncation issues

2017-05-18 Thread Michael Collison
This patch improves code generation for shifts with and operations that can be omitted based on the size of the operation. AArch64 variable shifts only use the low 5-6 bits so masking operations that clear higher bits can be removed. When the shift instructions operate on all register arguments the

Go patch committed: Pass -I to gotools build

2017-05-18 Thread Ian Lance Taylor
The Go compiler uses the -I option to find imported packages. It also supports -L options to find them, expecting -L options to be passed from the gccgo compiler driver. Because it expects -L to come from the driver, it searches VERSION and VERSION/MACHINE subdirectories first. The in-tree build

Re: [PATCH] rs6000: Separate shrink-wrapping for FPRs

2017-05-18 Thread Segher Boessenkool
On Thu, May 18, 2017 at 02:49:51PM -0500, Peter Bergner wrote: > On 5/18/17 12:51 PM, Segher Boessenkool wrote: > > This patch implements separate shrink-wrapping for the non-volatile > > floating point registers (FPR14..FPR31). It is pretty much exactly > > analogous to the code for GPRs. > > >

[PATCH] cfgcleanup: Ignore clobbers in bb_is_just_return

2017-05-18 Thread Segher Boessenkool
The function bb_is_just_return finds if the BB it is asked about does just a return and nothing else. It currently does not allow clobbers in the block either, which we of course can allow just fine. This patch changes that. Bootstrapped and tested on powerpc64-linux {-m32,-m64} (and tested that

Re: [PATCH] Try to fix recently introduced crashes in ggc_collect

2017-05-18 Thread Bernd Edlinger
Please disregard the unrelated change on cp/typeck.c, thanks. On 05/18/17 17:33, Richard Biener wrote: > On May 18, 2017 5:15:43 PM GMT+02:00, Bernd Edlinger > wrote: >> Hi, >> >> >> this attempts to fix occasional segmentation faults that are present in >> the current snapshot, while previous s

[PATCH] Try harder to fix recently introduced crashes in ggc_collect

2017-05-18 Thread Bernd Edlinger
Hi, unfortunately the first patch was still insufficient. I identified many more relatively new places where static tree objects are invisible to GC. Nathan, whatever you are doing, please do it a bit more slowly, thanks. Bootstrap and reg-testing on x86_64-pc-linux-gnu in progress. Is it OK af

Re: [PATCH] rs6000: Separate shrink-wrapping for FPRs

2017-05-18 Thread Peter Bergner
On 5/18/17 12:51 PM, Segher Boessenkool wrote: > This patch implements separate shrink-wrapping for the non-volatile > floating point registers (FPR14..FPR31). It is pretty much exactly > analogous to the code for GPRs. > > This has been tested on powerpc64-linux {-m32,-m64} for many months > now

[PATCH] enhance debug_tree() to print DECL_READ_P flag

2017-05-18 Thread Martin Sebor
The debug_tree() function doesn't print the DECL_READ_P flag for a VAR_DECL or PARM_DECL. The attached two like patch makes it do so. Martin gcc/ChangeLog: * print-tree.c (print_node): Print DECL_READ_P flag. /* Bit masks to control dumping. Not all values are applicable to all diff --git a/

Re: [New file, Ping] Add testcase to ensure that #pragma GCC diagnostic push/pop works with -Wtraditional.

2017-05-18 Thread David Malcolm
On Tue, 2017-05-02 at 12:56 -0400, Eric Gallager wrote: > On 3/24/17, Eric Gallager wrote: > > On 3/24/17, David Malcolm wrote: > > > On Fri, 2017-03-24 at 14:10 -0400, Eric Gallager wrote: > > > > The attached test case failed with gcc 4.9 and older, but > > > > started > > > > compiling success

PR80806

2017-05-18 Thread Prathamesh Kulkarni
Hi, The attached patch tries to fix PR80806 by warning when a variable is set using memset (and friends) but not used. I chose to warn in dse pass since dse would detect if the variable passed as 1st argument is a dead store. Does this approach look OK ? There were following fallouts observed duri

[C++ PATCH] OVERLOAD iterators #7

2017-05-18 Thread Nathan Sidwell
This patch adds OVL_USED_P, using TREE_USED, which marks when an overload is being used by a template body -- and hence is immutable. This replaces and extends the current OVL_ARG_DEPENDENT_P flag, which was just set for koenig lookups. We'll be generating other transient lookups, which can be

[PATCH, i386]: Fix PR 80799: x86-32 generates MMX without EMMS

2017-05-18 Thread Uros Bizjak
Hello! Attached patch fixes unwanted MMX reg generation on x86-32 by also allowing target to allocate SSE registers for MMX moves. The difference between x86-32 and x86-64 was historic, and is not needed any more. The patch also adds one missing inter-unit move handling to vec_concatv2di. 2017-05

Go patch committed: Ignore struct field tags for type conversion

2017-05-18 Thread Ian Lance Taylor
Go 1.8 includes a language change (https://golang.org/doc/go1.8#language): in an explicit conversion from one struct type to another, any field tags are ignored. This CL implements this language change in the gofrontend. The tests for this are in the gc testsuite, which will be copied into the gc

Re: [PATCH 2/2] [MSP430] Fix issues handling .persistent attribute (PR 78818)

2017-05-18 Thread Jozef Lawrynowicz
On 18 May 2017 at 16:46, Martin Sebor wrote: > + if (!message && TREE_NAME_EQ (name, ATTR_PERSIST) && !TREE_STATIC (* > node) > + && !TREE_PUBLIC (* node) && !DECL_EXTERNAL (* node)) > +message = "%qE attribute has no effect on automatic variables"; > > In code like this (both existing a

[PATCH] rs6000: Separate shrink-wrapping for FPRs

2017-05-18 Thread Segher Boessenkool
This patch implements separate shrink-wrapping for the non-volatile floating point registers (FPR14..FPR31). It is pretty much exactly analogous to the code for GPRs. This has been tested on powerpc64-linux {-m32,-m64} for many months now; I'll do one final test on powerpc64le-linux before commit

Re: [PATCH] PR c++/80544 strip cv-quals from cast results

2017-05-18 Thread Nathan Sidwell
On 05/18/2017 01:40 PM, Jonathan Wakely wrote: + /* A prvalue of non-class type is cv-unqualified. */ + if (TREE_CODE (type) != REFERENCE_TYPE && !CLASS_TYPE_P (type)) +type = cv_unqualified (type); + References can't be CV qualified, so the REFERENCE_TYPE check seems superfluous? na

Re: [PATCH] PR c++/80544 strip cv-quals from cast results

2017-05-18 Thread Jonathan Wakely
Ping for https://gcc.gnu.org/ml/gcc-patches/2017-04/msg01414.html ... On 27/04/17 17:59 +0100, Jonathan Wakely wrote: This is probably not the best way to do this, but it seems to work. I also tried to add a warning like EDG's (see the PR) but it gave a false positive for direct-list-init of sc

[PATCH] PR libstdc++/80478 make std::mem_fn work with noexcept functions

2017-05-18 Thread Jonathan Wakely
We need partial specializations of _Mem_fn for member function types that are noexcept(true). Rather than relying on deducing the exception-specification (which is not supported by Clang yet) I've just added some more uses of the macro that generates the partial specializations. PR libstd

Re: [Patch, committed as obvious] Remove stray comma from enum dump_kind

2017-05-18 Thread Paolo Carlini
... oops ;) / 2017-05-18 Paolo Carlini * dumpfile.h (enum dump_kind): Remove stray comma. Index: dumpfile.h === --- dumpfile.h (revision 248242) +++ dumpfile.h (working copy) @@ -52,7 +52,7 @@ enum d

[Patch, committed as obvious] Remove stray comma from enum dump_kind

2017-05-18 Thread Paolo Carlini
Hi, I'm seeing tons of warnings, committing the below as obvious. Thanks, Paolo. //

Re: [PATCH 2/3] Simplify wrapped binops

2017-05-18 Thread Bin.Cheng
On Thu, May 18, 2017 at 5:08 PM, Robin Dapp wrote: >> Any reason to expose tree-vrp.c internal interface here? The function >> looks quite expensive. Overflow check can be done by get_range_info >> and simple wi::cmp calls. Existing code like in >> tree-ssa-loop-niters.c already does that. Als

Re: [PATCH 0/3] Split off powerpcspe from rs6000 port

2017-05-18 Thread Segher Boessenkool
On Mon, May 15, 2017 at 08:51:49PM +, Segher Boessenkool wrote: > As discussed before, here is a series to split powerpcspe from the > rs6000 port. This series does not yet make any real changes to either > port: it is a copy of rs6000/ to powerpcspe/, with some renames and > some necessary ch

Re: [PATCH] Limit perf data buffer during profiling

2017-05-18 Thread Aldy Hernandez
On 05/18/2017 12:09 PM, Mike Stump wrote: On May 18, 2017, at 1:35 AM, Aldy Hernandez wrote: Andi Kleen writes: From: Andi Kleen With high -j parallelism the autofdo tests can randomly fail. autofdo uses Linux perf to record profiling data. Linux perf uses a locked perf buffer. By default

Re: [PATCH 0/3] Split off powerpcspe from rs6000 port

2017-05-18 Thread Segher Boessenkool
On Wed, May 17, 2017 at 07:35:15AM +0200, Sebastian Huber wrote: > On 15/05/17 22:51, Segher Boessenkool wrote: > >-- This uses powerpc-*-rtems*spe*; do we want powerpcspe-*-rtems* > >instead? Or both? > > I guess it will be powerpcspe-*-rtems*, but we have to fix our build > system in this

[PATCH] [MSP430] PR78838: Do not add section name prefixes when section name is .lowtext

2017-05-18 Thread Jozef Lawrynowicz
A patch for this bug was originally posted here: https://gcc.gnu.org/ml/gcc-patches/2017-02/msg01054.html There were some issues with that patch which I've now fixed. The MSP430 target supports the automatic placement of functions and data in different memory regions when passing the "-mdata-regio

Break out predicates to ipa-predicates.[ch]

2017-05-18 Thread Jan Hubicka
Hi, this patch moves the predicates implementation into its own file. All changes are cosmetic and does not affect code generated. Honza * Makeifle.in: Add ipa-predicate.o and ipa-predicate.h * ipa-inline-analysis.c (NUM_CONDITIONS): turn into predicate::num_conditions

Re: [PATCH] Limit perf data buffer during profiling

2017-05-18 Thread Mike Stump
On May 18, 2017, at 1:35 AM, Aldy Hernandez wrote: > > Andi Kleen writes: > >> From: Andi Kleen >> >> With high -j parallelism the autofdo tests can randomly fail. >> autofdo uses Linux perf to record profiling data. >> Linux perf uses a locked perf buffer. By default it has >> around 516k bu

Re: [PATCH 2/3] Simplify wrapped binops

2017-05-18 Thread Robin Dapp
> Any reason to expose tree-vrp.c internal interface here? The function > looks quite expensive. Overflow check can be done by get_range_info > and simple wi::cmp calls. Existing code like in > tree-ssa-loop-niters.c already does that. Also could you avoid using > comma expressions in condition

Re: [PATCH 2/2] [MSP430] Fix issues handling .persistent attribute (PR 78818)

2017-05-18 Thread Martin Sebor
On 05/17/2017 09:45 AM, Jozef Lawrynowicz wrote: Add warning to back end and add test. Patch is attached. If the patch is acceptable, I would appreciate if someone could commit it for me as I do not have write access. 2017-05-XX Jozef Lawrynowicz gcc/ PR target/78818 * config/msp4

Re: [PATCH 2/3] Simplify wrapped binops

2017-05-18 Thread Bin.Cheng
On Thu, May 18, 2017 at 3:47 PM, Robin Dapp wrote: > match.pd part of the patch. > > gcc/ChangeLog: > > 2017-05-18 Robin Dapp > > * match.pd: Simplify wrapped binary operations. > * tree-vrp.c (extract_range_from_binary_expr_1): Add overflow > parameter. > (extra

Re: [PATCH] Try to fix recently introduced crashes in ggc_collect

2017-05-18 Thread Richard Biener
On May 18, 2017 5:15:43 PM GMT+02:00, Bernd Edlinger wrote: >Hi, > > >this attempts to fix occasional segmentation faults that are present in >the current snapshot, while previous snapshot was stable. > >I observed numerous crashes but all were non-reproducible, >like the following example: > >In

[C++ PATCH] OVL_USED dies

2017-05-18 Thread Nathan Sidwell
While repurposing TREE_USED as OVL_USED to indicate it was found via a using declaration is 'cute', it's terribly confusing. Particularly as I now have the need for a 'this overload is being used' flag. This patch replaces OVL_USED with OVL_USING_P and maps it to one of the TREE_LANG flags.

[PATCH] Try to fix recently introduced crashes in ggc_collect

2017-05-18 Thread Bernd Edlinger
Hi, this attempts to fix occasional segmentation faults that are present in the current snapshot, while previous snapshot was stable. I observed numerous crashes but all were non-reproducible, like the following example: In file included from /home/ed/gnu/gcc-build-1/x86_64-pc-linux-gnu/libstd

Re: [PATCH] gcc::context creation

2017-05-18 Thread Nathan Sidwell
On 05/16/2017 11:26 AM, Nathan Sidwell wrote: This patch breaks apart the creation of the pass manager from gcc::context's ctor. This will allow us to register additional dumps ... https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01295.html This patch builds upon the context creation patch (this

[PATCH 3/3] Simplify wrapped binops

2017-05-18 Thread Robin Dapp
New testcases. gcc/testsuite/ChangeLog: 2017-05-18 Robin Dapp * gcc.dg/wrapped-binop-simplify-signed-1.c: New test. * gcc.dg/wrapped-binop-simplify-unsigned-1.c: New test. * gcc.dg/wrapped-binop-simplify-unsigned-2.c: New test. diff --git a/gcc/testsuite/gcc.dg/wrappe

[PATCH 2/3] Simplify wrapped binops

2017-05-18 Thread Robin Dapp
match.pd part of the patch. gcc/ChangeLog: 2017-05-18 Robin Dapp * match.pd: Simplify wrapped binary operations. * tree-vrp.c (extract_range_from_binary_expr_1): Add overflow parameter. (extract_range_from_binary_expr): Likewise. * tree-vrp.h: Export. d

[PATCH 1/3] Simplify wrapped binops

2017-05-18 Thread Robin Dapp
This tries to fold unconditionally and fixes some test cases. gcc/ChangeLog: 2017-05-18 Robin Dapp * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Always try to fold. gcc/testsuite/ChangeLog: 2017-05-18 Robin Dapp * g++.dg/tree-ssa

Re: [PATCH] Tree-level fix for PR 69526

2017-05-18 Thread Robin Dapp
> Hmm, won't (uint32_t + uint32_t-CST) doesn't overflow be sufficient > condition for such transformation? Yes, in principle this should suffice. What we're actually looking for is something like a "proper" (or no) overflow, i.e. an overflow in both min and max of the value range. In (a + cst1

[PATCH] Calculate scaled frequency in HOST_WIDE_INT (PR ipa/80663).

2017-05-18 Thread Martin Liška
Hello. Following simple fix removes ubsan in ipa-split.c as mentioned in the PR. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin >From f6230b40aa6f9d5a67e6231de2a26bc488dc784d Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 17 May 2017 1

Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-18 Thread Martin Liška
On 05/18/2017 03:36 PM, Thomas Schwinge wrote: > The very most, but not not all. Thanks for the fix. Martin

Re: [PATCH][PR sanitizer/77631] Support separate debug info in libbacktrace

2017-05-18 Thread Denis Khalikov
Hello everyone, i've updated the patch recently for this issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77631 Can someone please review it. Thanks. On 04/13/2017 01:07 AM, Jeff Law wrote: Given this doesn't look like a regression, I'm going to punt to gcc-8. jeff From: Denis Khalikov D

Re: [PATCH rs6000] Fix up dg-options for BMI intrinsic tests

2017-05-18 Thread Steven Munroe
On Wed, 2017-05-17 at 17:22 -0400, David Edelsohn wrote: > On Wed, May 17, 2017 at 4:56 PM, Steven Munroe > wrote: > > David pointed out that I my earlier X86 BMI intrinsic header submission > > was causing make check failures on on powerpc64le platforms. The patch > > below tests out on Linux BE

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-18 Thread Bernd Edlinger
On 05/17/17 04:01, Daniel Santos wrote: >> >> - if (ignore_outlined && cfun->machine->call_ms2sysv >> - && in_hard_reg_set_p (stub_managed_regs, DImode, regno)) >> -return false; >> + if (ignore_outlined && cfun->machine->call_ms2sysv) >> +{ >> + /* Registers who's save & restor

Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-18 Thread Thomas Schwinge
Hi! On Wed, 17 May 2017 11:02:09 +0200, Martin Liška wrote: > On 05/17/2017 09:44 AM, Richard Biener wrote: > > On Tue, May 16, 2017 at 4:55 PM, Martin Liška wrote: > >> On 05/16/2017 03:48 PM, Richard Biener wrote: > >>> On Fri, May 12, 2017 at 3:00 PM, Martin Liška wrote: > Second part c

[C++ PATCH] OVERLOAD iterators #6

2017-05-18 Thread Nathan Sidwell
This patch replaces the final few uses of ovl_cons and build_overload with the new lookup_add and ovl_insert interfaces. Not all the use locations are in their final form, but this does allow me to build out the feature set. Soon changes will be confined to name-lookup. While there I noticed

Re: [PATCH v2 04/N] Simplify usage of some TDF_* flags.

2017-05-18 Thread Martin Liška
On 05/17/2017 02:36 PM, Richard Biener wrote: > On Tue, May 16, 2017 at 3:53 PM, Martin Liška wrote: >> There's one another patch that merges some TDF_* flags that have >> very similar meaning and do not influence test-suite, because >> nobody is using them for scanning. >> >> Patch can bootstrap

Re: [PATCH v2 3/N] Transform TDF_{lang,tree,ipa,rtl} to dump_kind enum.

2017-05-18 Thread Martin Liška
On 05/17/2017 02:20 PM, Richard Biener wrote: > On Fri, May 12, 2017 at 3:04 PM, Martin Liška wrote: >> Third part removes TDF_* flags mentioned in the subject. These flags are used >> to enable all passes of specific type and Nathan has recently separated these >> by a new pair of macros. I hope

[PATCH] Implement non-trivial std::random_device::entropy (PR libstdc++/67578)

2017-05-18 Thread Xi Ruoyao
This patch use ioctl to get entropy of std::random_device using /dev/random and /dev/urandom. Regenerated files are mentioned in ChangeLog but not included in the patch. 2017-03-12  Xi Ruoyao   PR libstdc++/67578 * config.h.in: Regenerate. * configure: Regenerate.

[C PATCH] More cleanups

2017-05-18 Thread Marek Polacek
If a function returns a tree, return NULL_TREE instead of 0. Noticed some other trivialities, too. Bootstrapped/regtested on x86_64-linux, applying to trunk. 2017-05-18 Marek Polacek * c-common.c (c_common_type_for_size): Use NULL_TREE instead of 0. (c_common_fixed_point_type

Re: [C PATCH] delete unused function

2017-05-18 Thread Marek Polacek
On Thu, May 18, 2017 at 06:57:36AM -0400, Nathan Sidwell wrote: > In searching around for but 80803 I discovered that pushdecl_top_level > appears unused in the C FE. grepping under the gcc directory I find > definitions and uses in the c++ FE and separate def/use in the fortran FE. > In the C FE

[PATCH] Avoid signed overflow in num_get::_M_extract_int (PR libstdc++/67214)

2017-05-18 Thread Xi Ruoyao
This UB has been hiding so long... 2017-03-11  Xi Ruoyao   PR libstdc++/67214 * include/bits/locale_facets.tcc (_M_extract_int):   Add explicit conversion to avoid signed overflow. ---  libstdc++-v3/include/bits/locale_facets.tcc | 3 ++-  1 file changed, 2 insertions(+), 1

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-05-18 Thread Bin.Cheng
On Thu, May 18, 2017 at 11:41 AM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Wed, May 17, 2017 at 1:37 PM, Richard Sandiford >> wrote: >>> "Bin.Cheng" writes: -/* Calculates cost for having N_REGS registers. This number includes - induction variables, invariant variables

[PATCH][C fam] Fix PR80593, bogus strict-aliasing warnings

2017-05-18 Thread Richard Biener
The following reverts an earlier change of mine (2008) to explicitely warn about accessing alias-set zero memory with alias-set non-zero. That was supposed to catch the case in g++.dg/warn/Wstrict-aliasing-6.C which is int foo () { char buf[8]; return *((int *)buf); /* { dg-warning "strict-al

[C PATCH] delete unused function

2017-05-18 Thread Nathan Sidwell
In searching around for but 80803 I discovered that pushdecl_top_level appears unused in the C FE. grepping under the gcc directory I find definitions and uses in the c++ FE and separate def/use in the fortran FE. In the C FE I only find a definition. AFAICT this is a stale function and comm

C PATCH to use bool more (committed)

2017-05-18 Thread Marek Polacek
By eyeballing I found a couple of places where we should use bool. Bootstrapped/regtested on x86_64-linux, applying to trunk. 2017-05-18 Marek Polacek * c-common.c (self_promoting_args_p): Change the return type to bool. Use false/true instead of 0/1. * c-common.h (sel

[C++ PATCH] name-lookup args ordering

2017-05-18 Thread Nathan Sidwell
We're being inconsistent as to what order the name/scope args on lookup and insertion are placed. The lookup ones are scope:name whereas (some of) the insertion ones are name:scope. That's confusing. This patch fixes things up to consistently use scope:name. I also break out a local scope l

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-05-18 Thread Richard Sandiford
"Bin.Cheng" writes: > On Wed, May 17, 2017 at 1:37 PM, Richard Sandiford > wrote: >> "Bin.Cheng" writes: >>> -/* Calculates cost for having N_REGS registers. This number includes >>> - induction variables, invariant variables and invariant expressions. */ >>> +/* Estimate register pressure f

Re: [patch] build xz (instead of bz2) compressed tarballs and diffs

2017-05-18 Thread Richard Biener
On Mon, May 15, 2017 at 3:11 AM, Matthias Klose wrote: > As discussed on IRC with Jakub and Richard here are is a small patch which > builds xz compressed tarballs and diff files. > > Tested with > > maintainer-scripts/gcc_release \ > -s snap:trunk -p diffs sources tarfiles > maintain

[PR80693] drop value of parallel SETs dropped by combine

2017-05-18 Thread Alexandre Oliva
When an insn used by combine has multiple SETs, only the non-REG_UNUSED set is used: others will end up dropped on the floor. We have to take note of the dropped REG_UNUSED SETs, clearing their cached values, so that, even if the REGs remain used (e.g. because they were referenced in the used SET_

Re: [PATCH] Update libstdc++ version info in manual

2017-05-18 Thread Jonathan Wakely
On 18/05/17 11:09 +0100, Jonathan Wakely wrote: This adds the missing 7.1.0 version info to the manual, and adds a step about updating that in future when bumping the version. * doc/xml/manual/abi.xml: Document latest library versions. * doc/xml/manual/build_hacking.xml: Document

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-05-18 Thread Bin.Cheng
On Wed, May 17, 2017 at 1:37 PM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> -/* Calculates cost for having N_REGS registers. This number includes >> - induction variables, invariant variables and invariant expressions. */ >> +/* Estimate register pressure for loop having N_INVS invaria

[PATCH] Update libstdc++ version info in manual

2017-05-18 Thread Jonathan Wakely
This adds the missing 7.1.0 version info to the manual, and adds a step about updating that in future when bumping the version. * doc/xml/manual/abi.xml: Document latest library versions. * doc/xml/manual/build_hacking.xml: Document requirement to update abi.xml when bumpi

[PATCH,DWARF,v2] AIX dwarf2out label fix

2017-05-18 Thread David Edelsohn
This version adds a macro DWARF_INITIAL_LENGTH_SIZE_STR based on DWARF_OFFSET_SIZE to define the string expression to append to the label to correct the offset. Because AIX Assembler inserts the section length, the section label generated by GCC points to the wrong location and must be adjusted wh

[PATCH] Fix test to compile in C++98 mode

2017-05-18 Thread Jonathan Wakely
While backporting a commit to gcc-5-branch I noticed this test doesn't build in c++98 mode (the default on gcc-5-branch). Fixed like so. Tested x86_64-linux, committed to gcc-6-branch. commit db3afd0ee4833edd3ca967e40aef629a032575b8 Author: Jonathan Wakely Date: Thu May 18 10:07:47 2017 +0100

Re: [PATCH] Limit perf data buffer during profiling

2017-05-18 Thread Richard Biener
On Thu, May 18, 2017 at 10:35 AM, Aldy Hernandez wrote: > Andi Kleen writes: > >> From: Andi Kleen >> >> With high -j parallelism the autofdo tests can randomly fail. >> autofdo uses Linux perf to record profiling data. >> Linux perf uses a locked perf buffer. By default it has >> around 516k bu

Re: [PATCH] Limit perf data buffer during profiling

2017-05-18 Thread Aldy Hernandez
Andi Kleen writes: > From: Andi Kleen > > With high -j parallelism the autofdo tests can randomly fail. > autofdo uses Linux perf to record profiling data. > Linux perf uses a locked perf buffer. By default it has > around 516k buffer per uid (/proc/sys/kernel/perf_event_mlock_kb). > > An indivi

Re: Handle data dependence relations with different bases

2017-05-18 Thread Richard Sandiford
Richard Biener writes: > On Thu, May 4, 2017 at 7:21 PM, Richard Sandiford > wrote: >> Richard Biener writes: >>> On Thu, May 4, 2017 at 2:12 PM, Richard Biener >>> wrote: On Wed, May 3, 2017 at 10:00 AM, Richard Sandiford wrote: > This patch tries to calculate conservatively-cor

Re: Move X==15-X to match.pd

2017-05-18 Thread Richard Biener
On Thu, May 18, 2017 at 8:24 AM, Marc Glisse wrote: > Hello, > > just moving one simple transformation to match.pd. It is actually slightly > more general, because there is no point restricting to NOP conversions when > only the lowest bit matters. > > By the way, I was thinking of removing from f

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-18 Thread Daniel Santos
On 05/17/2017 01:39 PM, Bernd Edlinger wrote: On 05/15/17 03:39, Daniel Santos wrote: I should add that if you want to run faster tests just on the ms to sysv abi code, you can use make RUNTESTFLAGS="ms-sysv.exp" check and then if that succeeds run the full testsuite. Daniel Hmm, that's funn

Re: [ubsan PATCH] -fsanitize=null fails to sanitize &s->i (PR sanitizer/80797)

2017-05-18 Thread Marek Polacek
On Thu, May 18, 2017 at 09:03:31AM +0200, Richard Biener wrote: > On Wed, May 17, 2017 at 4:10 PM, Marek Polacek wrote: > > We are failing to detect accessing a null pointer in &s->i because > > v_3 = &s_2->i; > > is not gimple_assign_load_p: > > 1997 if (flag_sanitize & (SANITIZE_NULL |

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-05-18 Thread Richard Biener
On Wed, 17 May 2017, Martin Sebor wrote: > > The patch passes bootstrap+test on x86_64 and found a few functions in > > the source tree (attached func_names.txt) that could be annotated with > > malloc (I gave a brief look at some of the functions and didn't appear > > to be false positives but I

Re: [ubsan PATCH] -fsanitize=null fails to sanitize &s->i (PR sanitizer/80797)

2017-05-18 Thread Richard Biener
On Wed, May 17, 2017 at 4:10 PM, Marek Polacek wrote: > We are failing to detect accessing a null pointer in &s->i because > v_3 = &s_2->i; > is not gimple_assign_load_p: > 1997 if (flag_sanitize & (SANITIZE_NULL | SANITIZE_ALIGNMENT)) > 1998 { > 1999 if (gimple