Re: [RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-02-28 Thread Max Filippov
Richard, David, Eric, could you please take a look and possibly approve the below changes for sparc? On Sat, Feb 28, 2015 at 9:14 PM, Max Filippov wrote: > This allows a target to support both windowed and non-windowed ABI. > > 2015-02-28 Max Filippov > > gcc/ > * builtins.c (expand_b

Re: [RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-02-28 Thread Max Filippov
On Sun, Mar 1, 2015 at 8:34 AM, augustine.sterl...@gmail.com wrote: > On Sat, Feb 28, 2015 at 10:14 AM, Max Filippov wrote: >> This allows a target to support both windowed and non-windowed ABI. >> >> 2015-02-28 Max Filippov >> >> gcc/ >> * builtins.c (expand_builtin_return_addr): Add

Re: [RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-02-28 Thread augustine.sterl...@gmail.com
On Sat, Feb 28, 2015 at 10:14 AM, Max Filippov wrote: > This allows a target to support both windowed and non-windowed ABI. > > 2015-02-28 Max Filippov > > gcc/ > * builtins.c (expand_builtin_return_addr): Add > RETURN_ADDR_IN_PREVIOUS_FRAME to 'if' condition. > * config

Re: [PATCH] PR target/65248: [5 Regression] Copy relocation in PIE against protected symbol

2015-02-28 Thread Sandra Loosemore
On 02/28/2015 09:42 AM, H.J. Lu wrote: @@ -22704,6 +22705,13 @@ For systems that use the GNU C Library, the default is on. Specify that the assembler should encode SSE instructions with VEX prefix. The option @option{-mavx} turns this on by default. +@item -mcopyreloc-in-pie +@itemx -mno-c

Fix handling of OBJ_TYPE_REF in ipa-icf-gimple.c

2015-02-28 Thread Jan Hubicka
Hi, this patch fixes OBJ_TYPE_REF handling. We need to compare OTR type for match and we can skip comparing when devirtualization is disabled. Honza * ipa-icf-gimple.c (func_checker::compare_operand): Fix handling of OBJ_TYPE_REF. Index: ipa-icf-gimple.c ==

More of icf::merge TLC

2015-02-28 Thread Jan Hubicka
Hi, the prevoius bug in COMDAT handling made me to revisit the code once again. There was few bugs fixed bellow. 1) If we have resolution info and we know original is going to be discarded we need to prevail COMDAT logic 2) It is possible to merge non-comdat to comdat and comdat to non-comdat.

Fix option andling in can_inline_edge_p

2015-02-28 Thread Jan Hubicka
hi, this patch fixes bug in can_inline_edge_p where opt_for_fn is taken from inline clone and not function being inlined into itself. Those opt_for_fn are going to be ignored and thus have no meaning. I also fixed case wehre !flag_devirtualize would get inlined into flag_devirtualize but at WPA t

Re: [PATCH] ICF: move readonly decision for variables to the right place

2015-02-28 Thread Jan Hubicka
> diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c > index 864a5d0..5b1fcff 100644 > --- a/gcc/ipa-icf.c > +++ b/gcc/ipa-icf.c > @@ -1410,10 +1410,6 @@ sem_variable::parse (varpool_node *node, > bitmap_obstack *stack) >if (node->alias) > return NULL; > > - bool readonly = TYPE_P (decl) ? TYP

[PATCH] ICF: move readonly decision for variables to the right place

2015-02-28 Thread Martin Liška
Hello. This patch makes correctly decision about variables that are read-only and are candidates for merge operation. Tested on x86_64-unknown-linux-gnu. Ready for trunk? Thanks, Martin >From 72370368eb04a69bf36b42f692d44c21592bc94a Mon Sep 17 00:00:00 2001 From: mliska Date: Fri, 27 Feb 2015 2

Re: [PATCH] ICF is more strict about non-common function and var, attributes.

2015-02-28 Thread Jan Hubicka
> > > > Half of FAILs are gone, but the rest is correctly merged (alignment > > matches). Thus I would omit ICF > > in this testcase. I'm going to install the patch. Richard, I wonder what happens with TYPE_ALIGN at LTO. It is not part of canonical type definition and thus we get random alignm

Re: [PATCH] ICF is more strict about non-common function and var, attributes.

2015-02-28 Thread Jan Hubicka
> > Half of FAILs are gone, but the rest is correctly merged (alignment matches). > Thus I would omit ICF > in this testcase. I'm going to install the patch. > > Thanks, > Martin > >From 60c5fdc5d5bab2d26a43813ffebda247c8dd1fce Mon Sep 17 00:00:00 2001 > From: mliska > Date: Fri, 27 Feb 2015 2

Re: [PATCH] ICF is more strict about non-common function and var, attributes.

2015-02-28 Thread Martin Liška
On 02/28/2015 11:42 PM, Jan Hubicka wrote: >> >> 2015-02-28 Martin Liska >> Jan Hubicka >> >> * ipa-icf-gimple.c (func_checker::compare_variable_decl): >> Validate variable alignment. >> * ipa-icf.c (sem_function::equals_private): Be more precise >> about non-comm

Re: [PATCH] ICF is more strict about non-common function and var, attributes.

2015-02-28 Thread Jan Hubicka
> > 2015-02-28 Martin Liska > Jan Hubicka > > * ipa-icf-gimple.c (func_checker::compare_variable_decl): > Validate variable alignment. > * ipa-icf.c (sem_function::equals_private): Be more precise > about non-common function attributes. > (sem_variabl

Re: [PATCH] Fix for PR ipa/65245

2015-02-28 Thread Jan Hubicka
> Hello. > > Following patch skips all variable aliases as potential merge candidates. > Tested on x86_64-linux. > > Ready for trunk? > Thanks, > Martin > >From fbde2e98f98a71105d18cf3e91e8032d0c657139 Mon Sep 17 00:00:00 2001 > From: mliska > Date: Fri, 27 Feb 2015 22:42:49 +0100 > Subject: [

Prevent merging across COMDAT group boundary

2015-02-28 Thread Jan Hubicka
Hi, tihs patch fixes one case I forgot in sem_function::merge: When target is not in comdat group, we still can not make alias in the case source is. Bootstrapped/regtested x86_64-linux, Martin, can you double check this fixes the xalancbmk? Honza PR ipa/65237 * ipa-icf.c (sem_f

Fix PR ipa/65232 (icf_merge breaking anchors)

2015-02-28 Thread Jan Hubicka
Hi, this patch fixes ICE where we produce RTL because of notice_global_symbol but this RTL is no longer valid after turning symbol into an alias. Bootstrapped/regtested x86_64-linux, will commit it shortly. Honza PR ipa/65232 * ipa-icf.c (clear_decl_rtl): New function. (s

[PATCH] ICF is more strict about non-common function and var, attributes.

2015-02-28 Thread Martin Liška
Hello. Following patch is guard for special non-common function attributes that can be spotted by ICF machinery. Tested on x86_64-linux. Ready for trunk? Thanks, Martin >From 13e8c55b6317bf4e2c21ef04305cb3a20ad51255 Mon Sep 17 00:00:00 2001 From: mliska Date: Fri, 27 Feb 2015 21:49:46 +0100 Sub

[PATCH] Fix for PR ipa/65245

2015-02-28 Thread Martin Liška
Hello. Following patch skips all variable aliases as potential merge candidates. Tested on x86_64-linux. Ready for trunk? Thanks, Martin >From fbde2e98f98a71105d18cf3e91e8032d0c657139 Mon Sep 17 00:00:00 2001 From: mliska Date: Fri, 27 Feb 2015 22:42:49 +0100 Subject: [PATCH 2/4] ICF: Do not co

Re: Fix thunk generation for functions returning DECL_BY_REFERENCE

2015-02-28 Thread Andreas Schwab
Jan Hubicka writes: > +struct A { > > + A() {ptr=&b;} > > + A(const A &a) {ptr = &b;} > > + void test()

Fix thunk generation for functions returning DECL_BY_REFERENCE

2015-02-28 Thread Jan Hubicka
Hi, the Chromium miscompilation is caused by introducing extra copy when returning non-POD object (as tested in the testcase). This is bug in cgraph_node::expand_thunk not setting gimple_call_set_return_slot_opt (I copied same code from ipa-split). This bug should reproduce on all release branch

[RFC 2/2] Implement call0 ABI for xtensa

2015-02-28 Thread Max Filippov
call0 is an ABI that doesn't use register windows. 2015-02-28 Max Filippov gcc/ * config/xtensa/constraints.md ("a" constraint): Include stack pointer in case of call0 ABI. ("q" constraint): Make empty in case of call0 ABI. ("D" constraint): Include stack pointe

[RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-02-28 Thread Max Filippov
This allows a target to support both windowed and non-windowed ABI. 2015-02-28 Max Filippov gcc/ * builtins.c (expand_builtin_return_addr): Add RETURN_ADDR_IN_PREVIOUS_FRAME to 'if' condition. * config/sparc/sparc.h (RETURN_ADDR_IN_PREVIOUS_FRAME): Change defini

[RFC 0/2] xtensa: add call0 ABI support

2015-02-28 Thread Max Filippov
Hello, this series adds call0 ABI support for xtensa. Code generation part is well tested, but I'm not 100% sure about the exception handling part. Please review. Max Filippov (2): Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression Implement call0 ABI for xtensa gcc/builtins.c

Re: ipa-icf::merge TLC

2015-02-28 Thread Jan Hubicka
> > Hi Honza, > > This is more a note for other interested AArch64 testers, but this patch > breaks some tests on aarch64-none-elf. Looking at the test output, this > is a problem with the tests than with your patch. We now eliminate some > function bodies which are identical across test function

[PATCH] PR target/65248: [5 Regression] Copy relocation in PIE against protected symbol

2015-02-28 Thread H.J. Lu
Ue copy relocation in PIE improves performance. But copy relocation can't be used to access protected symbols defined in shared libaries and linker in binutils 2.26 enforces doesn't allow it. GCC doesn't know if an external definition is protected or not. This option adds -mcopyreloc-in-pie to g

Re: [patch, avr] Take 2: Fix PR64331: insn output and insn length computation rely on REG_DEAD notes.

2015-02-28 Thread Georg-Johann Lay
Am 02/26/2015 um 11:45 PM schrieb Steven Bosscher: On Thu, Feb 26, 2015 at 8:35 PM, Georg-Johann Lay wrote: Take #2 introduces a new, avr-specific rtl pass whose sole purpose is to rectify notes. The pass is scheduled right before cfg does down (right before .*free_cfg) so that cfg and hence df

Re: [patch] Fix ICE on unaligned record field

2015-02-28 Thread Eric Botcazou
> for various reasons I was not able to do it earlier, but today I have > re-bootstrapped the following (the only change is the added testcase) > on x86_64-linux and it passes OK. Should I commit it to trunk then? Yes, that would be kind of you, thanks in advance. -- Eric Botcazou

Re: ipa-icf::merge TLC

2015-02-28 Thread James Greenhalgh
On Fri, Feb 27, 2015 at 02:10:47AM +, Jan Hubicka wrote: > * ipa-icf.c (symbol_compare_collection::symbol_compare_colleciton): > Use address_matters_p. > (redirect_all_callers, set_addressable): New functions. > (sem_function::merge): Reorganize and fix merging i

Re: [PATCH][AArch64]: Fix rtl type in aarch64.md.

2015-02-28 Thread Xingxing Pan
On 02/28/2015 04:39 PM, James Greenhalgh wrote: On Sat, Feb 28, 2015 at 01:29:15AM +, Xingxing Pan wrote: On 02/27/2015 04:30 PM, Marcus Shawcroft wrote: On 26 February 2015 at 06:22, Xingxing Pan wrote: This patch fix the type of mov_aarch64 in aarch64.md. Is it OK for trunk? OK, thank

Re: [PATCH][AArch64]: Fix rtl type in aarch64.md.

2015-02-28 Thread James Greenhalgh
On Sat, Feb 28, 2015 at 01:29:15AM +, Xingxing Pan wrote: > On 02/27/2015 04:30 PM, Marcus Shawcroft wrote: > > On 26 February 2015 at 06:22, Xingxing Pan wrote: > >> This patch fix the type of mov_aarch64 in aarch64.md. > >> Is it OK for trunk? > > > > OK, thank you /Marcus > > > > Could some

Re: [patch, avr] Take 2: Fix PR64331: insn output and insn length computation rely on REG_DEAD notes.

2015-02-28 Thread Denis Chertykov
2015-02-27 1:45 GMT+03:00 Steven Bosscher : > On Thu, Feb 26, 2015 at 8:35 PM, Georg-Johann Lay wrote: >> Take #2 introduces a new, avr-specific rtl pass whose sole purpose is to >> rectify notes. The pass is scheduled right before cfg does down (right >> before .*free_cfg) so that cfg and hence d