[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-11-02 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Martin Jambor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #14 from Martin Jambor  ---
OK, so hopefully finally fixed everywhere.

[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-11-02 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

--- Comment #13 from Martin Jambor  ---
Author: jamborm
Date: Mon Nov  2 14:04:19 2015
New Revision: 229666

URL: https://gcc.gnu.org/viewcvs?rev=229666=gcc=rev
Log:
2015-11-02  Martin Jambor  

PR tree-optimization/67794
* tree-sra.c (replace_removed_params_ssa_names): Do not distinguish
between types of statements but accept original definitions as a
parameter.
(ipa_sra_modify_function_body): Use FOR_EACH_SSA_DEF_OPERAND to
iterate over definitions.

testsuite/
* gcc.dg/ipa/ipa-sra-10.c: New test.
* gcc.dg/torture/pr67794.c: Likewise.


Added:
branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/ipa/ipa-sra-10.c
branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr67794.c
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
branches/gcc-4_9-branch/gcc/tree-sra.c

[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-30 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Christophe Lyon  changed:

   What|Removed |Added

 CC||clyon at gcc dot gnu.org

--- Comment #12 from Christophe Lyon  ---
(In reply to Renlin Li from comment #11)
> > 
> > Hi Martin,
> > 
> > After the backport patch to branch 5, aarch-none-elf fails to build because
> > of the following ICEs.
> > 
> 
> I mean "aarch64-none-elf" here, sorry for the typo.

This was fixed at r229435.


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-27 Thread renlin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

renlin at gcc dot gnu.org changed:

   What|Removed |Added

 CC||renlin at gcc dot gnu.org

--- Comment #10 from renlin at gcc dot gnu.org ---
 (In reply to Martin Jambor from comment #9)
> Author: jamborm
> Date: Mon Oct 26 14:36:43 2015
> New Revision: 229367
> 
> URL: https://gcc.gnu.org/viewcvs?rev=229367=gcc=rev
> Log:
> Also remap SSA_NAMEs of PARM_DECLs in IPA-SRA
> 
> 2015-10-26  Martin Jambor  
> 
>   PR tree-optimization/67794
>   * tree-sra.c (replace_removed_params_ssa_names): Do not distinguish
>   between types of statements but accept original definitions as a
>   parameter.
>   (ipa_sra_modify_function_body): Use FOR_EACH_SSA_DEF_OPERAND to
>   iterate over definitions.
> 
> testsuite/
> * gcc.dg/ipa/ipa-sra-10.c: New test.
> * gcc.dg/torture/pr67794.c: Likewise.
> 
> 
> Added:
> branches/gcc-5-branch/gcc/testsuite/gcc.dg/ipa/ipa-sra-10.c
> branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67794.c
> Modified:
> branches/gcc-5-branch/gcc/ChangeLog
> branches/gcc-5-branch/gcc/testsuite/ChangeLog
> branches/gcc-5-branch/gcc/tree-sra.c

Hi Martin,

After the backport patch to branch 5, aarch-none-elf fails to build because of
the following ICEs.

gcc/gcc/tree-sra.c: In function ‘tree_node*
replace_removed_params_ssa_names(tree, gimple_statement_base**,
ipa_parm_adjustment_vec)’:
gcc/gcc/tree-sra.c:4609:39: error: cannot convert ‘gimple_statement_base**’ to
‘gimple’ for argument ‘2’ to ‘tree_node* make_ssa_name(tree, gimple)’
gcc/gcc/tree-sra.c: In function ‘bool
ipa_sra_modify_function_body(ipa_parm_adjustment_vec)’:
gcc/gcc/tree-sra.c:4703:73: error: cannot convert ‘gphi*’ to
‘gimple_statement_base**’ for argument ‘2’ to ‘tree_node*
replace_removed_params_ssa_names(tree, gimple_statement_base**,
ipa_parm_adjustment_vec)’
gcc/gcc/tree-sra.c:4772:23: error: cannot convert ‘gimple’ to
‘gimple_statement_base**’ for argument ‘2’ to ‘tree_node*
replace_removed_params_ssa_names(tree, gimple_statement_base**,
ipa_parm_adjustment_vec)’

[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-27 Thread renlin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

--- Comment #11 from renlin at gcc dot gnu.org ---
> 
> Hi Martin,
> 
> After the backport patch to branch 5, aarch-none-elf fails to build because
> of the following ICEs.
> 

I mean "aarch64-none-elf" here, sorry for the typo.


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-26 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

--- Comment #9 from Martin Jambor  ---
Author: jamborm
Date: Mon Oct 26 14:36:43 2015
New Revision: 229367

URL: https://gcc.gnu.org/viewcvs?rev=229367=gcc=rev
Log:
Also remap SSA_NAMEs of PARM_DECLs in IPA-SRA

2015-10-26  Martin Jambor  

PR tree-optimization/67794
* tree-sra.c (replace_removed_params_ssa_names): Do not distinguish
between types of statements but accept original definitions as a
parameter.
(ipa_sra_modify_function_body): Use FOR_EACH_SSA_DEF_OPERAND to
iterate over definitions.

testsuite/
* gcc.dg/ipa/ipa-sra-10.c: New test.
* gcc.dg/torture/pr67794.c: Likewise.


Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/ipa/ipa-sra-10.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr67794.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-sra.c


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-26 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

--- Comment #8 from Martin Jambor  ---
For the record, the patch got into trunk as revision r228654, I made a
mistake in the ChangeLog tag and so it did not appear here.  I am
about to backport it to gcc 5.


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-08 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

--- Comment #7 from Martin Jambor  ---
I have proposed a fix on the mailing list:

https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00858.html


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-07 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Martin Jambor  changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu.org
   Assignee|aoliva at gcc dot gnu.org  |jamborm at gcc dot 
gnu.org

--- Comment #6 from Martin Jambor  ---
(In reply to Alexandre Oliva from comment #5)
> Martin, why doesn't SRA's modify_function use tree_versioning's args_to_skip
> infrastructure to remap the function

Because it does a few more transformations than just plain removal.
In fact, the plan (very long term, apparently) is to replace
args_to_skip with something akin to IPA-SRA's adjustments so that we
can do all this in truly IPA way.

>, including its prototype, and instead
> makes an (incomplete) work itself?  We end up with cloned PARM_DECLs that
> aren't parms at all, which may confuse other parts of the compiler.

Well, it does that, of course, otherwise it would have never passed
the testsuite, it's just that, ehm, the remapping from PARM_DECLS to
VAR_DECLs is not called when processing GIMPLE_ASMs.

I'll prepare a fix.


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-06 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Alexandre Oliva  changed:

   What|Removed |Added

 CC||mjambor at suse dot cz

--- Comment #5 from Alexandre Oliva  ---
Martin, why doesn't SRA's modify_function use tree_versioning's args_to_skip
infrastructure to remap the function, including its prototype, and instead
makes an (incomplete) work itself?  We end up with cloned PARM_DECLs that
aren't parms at all, which may confuse other parts of the compiler.


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-06 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Alexandre Oliva  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |aoliva at gcc dot 
gnu.org

--- Comment #4 from Alexandre Oliva  ---
Created attachment 36454
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36454=edit
Patch that removes the crash

This patch fixes the problem by tolerating IPA ESRA's leaving removed
PARM_DECLs alone, instead of replacing them with VAR_DECLs.  I would rather we
used a VAR_DECL instead, because I'm concerned about other places that
distinguish between PARM_DECLs and VAR_DECLs, at least when it comes to
handling their default defs.  I haven't looked into this possibility yet,
though; it might be that other pieces of the compiler rely on the decls
remaining as PARM_DECLs for other purposes.


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-01 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-10-01
 CC||trippels at gcc dot gnu.org
Summary|internal compiler error:|[6 regression] internal
   |Segmentation fault  |compiler error:
   ||Segmentation fault
 Ever confirmed|0   |1

--- Comment #1 from Markus Trippelsdorf  ---
int *b;
static void fn1(int *best, int *dmin) {
  int a[64];
  dmin = a;
  __asm__ volatile("" : "+"(dmin) : ""(best));
}

__attribute__((always_inline)) static void fn2(int *best) { fn1(best, b); }

void fn3(void) {
  int c[1];
  fn2(c);
}


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-01 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
So started with r228175.


[Bug tree-optimization/67794] [6 regression] internal compiler error: Segmentation fault

2015-10-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67794

Richard Biener  changed:

   What|Removed |Added

 CC||aoliva at gcc dot gnu.org
   Target Milestone|--- |6.0

--- Comment #2 from Richard Biener  ---
We fail to have a default-def for a PARM_DECL in this case.  The PARM_DECL was
created by function versioning so eventually the code that makes sure we always
have a default def for PARM_DECLs doesn't trigger (the function is versioned
when already in SSA form).