[Bug tree-optimization/51694] [4.7 Regression] ICE while compiling alliance package

2012-01-08 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51694

--- Comment #3 from Jan Hubicka hubicka at gcc dot gnu.org 2012-01-08 
16:32:57 UTC ---
Author: hubicka
Date: Sun Jan  8 16:32:49 2012
New Revision: 182993

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=182993
Log:
PR tree-optimize/51694
* ipa-cp.c (ipa_get_indirect_edge_target): Add bounds checks.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr51694.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-cp.c
trunk/gcc/testsuite/ChangeLog


[Bug tree-optimization/51694] [4.7 Regression] ICE while compiling alliance package

2012-01-08 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51694

Jan Hubicka hubicka at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #4 from Jan Hubicka hubicka at gcc dot gnu.org 2012-01-08 
16:35:46 UTC ---
Fixed.


[Bug tree-optimization/51694] [4.7 Regression] ICE while compiling alliance package

2012-01-06 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51694

Jan Hubicka hubicka at gcc dot gnu.org changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org
 AssignedTo|unassigned at gcc dot   |hubicka at gcc dot gnu.org
   |gnu.org |

--- Comment #2 from Jan Hubicka hubicka at gcc dot gnu.org 2012-01-06 
11:46:55 UTC ---
This is the usual argument count mismatch. Foo is called only with one
argument, but we don't do bound check when handling indirect call logic.
The patch also disable logic in ipa-inline propagatic across uninlinable calls.
We can not do that correctly + we will never inline the call anyway.

I am testing the attached patch.

Honza

Index: ipa-cp.c
===
*** ipa-cp.c(revision 182949)
--- ipa-cp.c(working copy)
*** ipa_get_indirect_edge_target (struct cgr
*** 1112,1118 

if (!ie-indirect_info-polymorphic)
  {
!   tree t = VEC_index (tree, known_vals, param_index);
if (t 
  TREE_CODE (t) == ADDR_EXPR
   TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL)
--- 1112,1119 

if (!ie-indirect_info-polymorphic)
  {
!   tree t = (VEC_length (tree, known_vals)  param_index
!   ? VEC_index (tree, known_vals, param_index) : NULL);
if (t 
  TREE_CODE (t) == ADDR_EXPR
   TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL)
*** ipa_get_indirect_edge_target (struct cgr
*** 1126,1132 
otr_type = ie-indirect_info-otr_type;

t = VEC_index (tree, known_vals, param_index);
!   if (!t  known_binfos)
  t = VEC_index (tree, known_binfos, param_index);
if (!t)
  return NULL_TREE;
--- 1127,1133 
otr_type = ie-indirect_info-otr_type;

t = VEC_index (tree, known_vals, param_index);
!   if (!t  known_binfos  VEC_length (tree, known_binfos)  param_index)
  t = VEC_index (tree, known_binfos, param_index);
if (!t)
  return NULL_TREE;

Index: ipa-inline-analysis.c
===
*** ipa-inline-analysis.c   (revision 182949)
--- ipa-inline-analysis.c   (working copy)
*** evaluate_properties_for_edge (struct cgr
*** 728,733 
--- 728,734 
  *known_binfos_ptr = NULL;

if (ipa_node_params_vector
+!e-call_stmt_cannot_inline_p
 ((clause_ptr  info-conds) || known_vals_ptr || known_binfos_ptr))
  {
struct ipa_node_params *parms_info;


[Bug tree-optimization/51694] [4.7 Regression] ICE while compiling alliance package

2012-01-04 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51694

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1


[Bug tree-optimization/51694] [4.7 Regression] ICE while compiling alliance package

2011-12-28 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51694

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.7.0


[Bug tree-optimization/51694] [4.7 Regression] ICE while compiling alliance package

2011-12-28 Thread mkuvyrkov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51694

Maxim Kuvyrkov mkuvyrkov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011-12-28
 Ever Confirmed|0   |1

--- Comment #1 from Maxim Kuvyrkov mkuvyrkov at gcc dot gnu.org 2011-12-28 
11:09:29 UTC ---
Will investigate.

Jakub, thanks for reporting this.