[Bug middle-end/34483] wo_prof_two_strs.c:56: internal compiler error: in find_new_var_of_type, at ipa-struct-reorg.c:605

2008-01-29 Thread alond at il dot ibm dot com


--- Comment #59 from alond at il dot ibm dot com  2008-01-29 10:01 ---
(In reply to comment #58)

> On hppa2.0w-hp-hpux11.11, we are down to:
Dave, 

Can you please try this patch:

Index: ipa-struct-reorg.c
===
--- ipa-struct-reorg.c (revision 131933)
+++ ipa-struct-reorg.c (working copy)
@@ -614,7 +614,7 @@
 gen_size (tree num, tree type, tree *res)
 {
   tree struct_size = TYPE_SIZE_UNIT (type);
-  HOST_WIDE_INT struct_size_int = TREE_INT_CST_LOW (struct_size);
+  HOST_WIDE_INT struct_size_int = int_cst_value (struct_size);
   tree new_stmt;

   *res = create_tmp_var (TREE_TYPE (num), NULL);
@@ -1787,7 +1787,7 @@
 return NULL_TREE;

   struct_size = TYPE_SIZE_UNIT (str_decl);
-  struct_size_int = TREE_INT_CST_LOW (struct_size);
+  struct_size_int = int_cst_value (struct_size);

   gcc_assert (struct_size);

Alon


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34483



[Bug middle-end/35041] New: ICE in tree-ssa-ccp.c with -fipa-struct-reorg

2008-01-31 Thread alond at il dot ibm dot com
The following testcase fails for me when compiled with -O3 -fwhole-program
-fdump-ipa-all -combine -fipa-type-escape -fipa-struct-reorg

#include 

typedef struct test_struct
{
  int a;
  int b;
} type_struct;

typedef type_struct **struct_pointer2;

struct_pointer2 str1;

int main()
{
  int i, j;

  str1 = malloc (2 * sizeof (type_struct*));

  for (i=0; i<=1; i++)
str1[i] = malloc (2 * sizeof (type_struct));

  return 0;
}

The failure is:

try11.c: In function 'main':
try11.c:23: internal compiler error: in create_general_new_stmt, at
ipa-struct-reorg.c:1323
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
   Summary: ICE in tree-ssa-ccp.c with -fipa-struct-reorg
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: alond at il dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35041



[Bug middle-end/34483] wo_prof_two_strs.c:56: internal compiler error: in find_new_var_of_type, at ipa-struct-reorg.c:605

2008-01-31 Thread alond at il dot ibm dot com


--- Comment #61 from alond at il dot ibm dot com  2008-01-31 18:07 ---
> Done.  Still have same fails on hppa2.0w-hp-hpux11.11.

Dave, 
can you please perform an initial debugging?
I think it will make it easier to loacte the bug if we had some debugging
information, like where is the 
failure etc.
If you can also check the sizeof: HOST_WIDE_INT, int, unsigned HOST_WIDE_INT.

Thank you for the cooperation,

Alon


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34483



[Bug middle-end/34701] New: ICE in tree-ssa-ccp.c with -fipa-struct-reorg

2008-01-07 Thread alond at il dot ibm dot com
The following testcase fails for me when run with -fipa-struct-reorg:

#include 

typedef struct baba
{
  int a;
  int b[10];
} type_struct;

type_struct *str1;

int main()
{
  int i;

  str1 = malloc (10 * sizeof (type_struct));

  for (i=0; i<=9; i++)
str1[i].a = str1[i].b[0];

  return 0;
}

The failure is:

try2.c: In function ‘main’:
try2.c:12: internal compiler error: in set_lattice_value, at tree-ssa-ccp.c:486
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
   Summary: ICE in tree-ssa-ccp.c with -fipa-struct-reorg
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: alond at il dot ibm dot com
 GCC build triplet: powerpc-suse-linux
  GCC host triplet: powerpc-suse-linux
GCC target triplet: powerpc-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34701



[Bug middle-end/34701] ICE in tree-ssa-ccp.c with -fipa-struct-reorg

2008-01-07 Thread alond at il dot ibm dot com


--- Comment #1 from alond at il dot ibm dot com  2008-01-07 09:47 ---
(In reply to comment #0)
When looking into try2.c.051i.ipa_struct_reorg, there is something strange like
10=40 there:

:
  D.1885_2 = malloc (440);
  str1.0_3 = (struct type_struct *) D.1885_2;
  10 = 40;
  D.1904_18 = malloc (D.1903_17(D));
  str1.0.3_19 = (struct baba_sub.0 *) D.1904_18;
  D.1905_20 = 10 << 2;
  D.1906_21 = malloc (D.1905_20);
  str1.0.4_22 = (struct baba_sub.1 *) D.1906_21;
  str1 ={v} str1.0_3;
  str1.1 ={v} str1.0.4_22;
  str1.0 ={v} str1.0.3_19;
  goto ;

Alon


-- 

alond at il dot ibm dot com changed:

   What|Removed |Added

 CC|    |alond at il dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34701



[Bug middle-end/34701] ICE in tree-ssa-ccp.c with -fipa-struct-reorg

2008-01-07 Thread alond at il dot ibm dot com


--- Comment #3 from alond at il dot ibm dot com  2008-01-07 13:01 ---
I have tested the following patch. It fixes the problem. All struct-reorg tests
has also passed on my machine.

It looks like the input to malloc was not calculated correctly in case the size
of the structure is not the order of 2.

Index: ipa-struct-reorg.c
===
--- ipa-struct-reorg.c  (revision 131371)
+++ ipa-struct-reorg.c  (working copy)
@@ -623,7 +623,12 @@
 add_referenced_var (*res);

   if (exact_log2 (struct_size_int) == -1)
-new_stmt = build_gimple_modify_stmt (num, struct_size);
+{
+  tree size = build_int_cst (TREE_TYPE (num), struct_size_int);
+  new_stmt = build_gimple_modify_stmt (*res, build2 (MULT_EXPR,
+TREE_TYPE (num),
+num, size));
+}
   else
 {
   tree C = build_int_cst (TREE_TYPE (num), exact_log2 (struct_size_int));

Ok to submit this patch?

Alon


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34701