Bug 36244 - -ftree-parallelize-loops=4, vectorizer enabled, ICE
Summary: -ftree-parallelize-loops=4, vectorizer enabled, ICE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.3.1
Assignee: Richard Biener
URL:
Keywords: alias, ice-on-valid-code
Depends on:
Blocks: 26359
  Show dependency treegraph
 
Reported: 2008-05-15 09:45 UTC by razya
Modified: 2008-05-20 21:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.3.1
Last reconfirmed: 2008-05-15 12:44:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description razya 2008-05-15 09:45:08 UTC
/* { dg-do compile } */
/* { dg-options "-O3 -ftree-parallelize-loops=4 -c" } */

struct p7prior_s {

  int   mnum;                   /* number of mat emission Dirichlet mixtures */
  float mq[200];          /* probabilities of mnum components          */
  float m[200][20];  /* match emission terms per mix component    */

};

struct p7prior_s *default_amino_prior(void);
struct p7prior_s *P7AllocPrior(void);

struct p7prior_s *
default_amino_prior(void)
{
  struct p7prior_s *pri;
  int x, q;

  static float defmq[5] = {
    0.178091, 0.056591, 0.0960191, 0.0781233, 0.0834977 };
 static float defm[5][6] = {
    { 0.270671, 0.039848, 0.017576, 0.016415, 0.014268,
      0.216147 },
    { 0.021465, 0.010300, 0.011741, 0.010883, 0.385651,
      0.029156 },
    { 0.561459, 0.045448, 0.438366, 0.764167, 0.087364,
      0.583402 },
    { 0.070143, 0.011140, 0.019479, 0.094657, 0.013162,
      0.073732 },
    { 0.041103, 0.014794, 0.005610, 0.010216, 0.153602,
      0.012049 }
  };

  pri = P7AllocPrior();
  pri->mnum  = 5;
  for (q = 0; q < pri->mnum; q++)
    {
      pri->mq[q] = defmq[q];
      for (x = 0; x < 6; x++)
        pri->m[q][x] = defm[q][x];
    }
  return pri;
}

prior.c:17: internal compiler error: in add_call_clobber_ops, at
tree-ssa-operands.c:1822
this was tested on power6, when both vectoriztion and autopar are enabled.
no failure when enabled seperately.
Comment 1 Richard Biener 2008-05-15 10:12:50 UTC
Confirmed.  The problem is how we compute MTAG_GLOBAL and call clobbering.
We assert that "unmodifiable" variables are not call clobbered and
"unmodifiable" is if MTAG_GLOBAL && TREE_READONLY.  Now we transition between
unmodifiable and not unmodifiable in compute_tag_properties and are not
careful making an already call clobbered variable unmodifiable.

The simplest fix is to remove the offending assert (we only believe we have
extra call clobbering - but I think this is not true in general).

Note I cannot reproduce this on the trunk but on the 4.3 branch only.
Comment 2 Richard Biener 2008-05-15 10:32:14 UTC
Pragmatic fix:

Index: tree-ssa-alias.c
===================================================================
--- tree-ssa-alias.c    (revision 135330)
+++ tree-ssa-alias.c    (working copy)
@@ -3672,7 +3672,8 @@ new_type_alias (tree ptr, tree var, tree
     }
 
   set_symbol_mem_tag (ptr, ali);
-  TREE_READONLY (tag) = TREE_READONLY (var);
+  /* We cannot set TREE_READONLY on the new tag as this conflicts with
+     propagating call clobbered info.  */
   MTAG_GLOBAL (tag) = is_global_var (var);
 }
 
Comment 3 razya 2008-05-15 11:15:14 UTC
(In reply to comment #2)
> Pragmatic fix:
> Index: tree-ssa-alias.c
> ===================================================================
> --- tree-ssa-alias.c    (revision 135330)
> +++ tree-ssa-alias.c    (working copy)
> @@ -3672,7 +3672,8 @@ new_type_alias (tree ptr, tree var, tree
>      }
>    set_symbol_mem_tag (ptr, ali);
> -  TREE_READONLY (tag) = TREE_READONLY (var);
> +  /* We cannot set TREE_READONLY on the new tag as this conflicts with
> +     propagating call clobbered info.  */
>    MTAG_GLOBAL (tag) = is_global_var (var);
>  }

The benchmarks now pass... Thanks.
Comment 4 Richard Biener 2008-05-15 11:59:07 UTC
Actually this is caused by the fix for PR26359.
Comment 5 Richard Biener 2008-05-15 12:44:50 UTC
Fixed on the trunk.
Comment 6 Richard Biener 2008-05-15 12:45:27 UTC
Subject: Bug 36244

Author: rguenth
Date: Thu May 15 12:44:42 2008
New Revision: 135336

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135336
Log:
2008-05-15  Richard Guenther  <rguenther@suse.de>

	PR middle-end/36244
	* tree-ssa-alias.c (new_type_alias): Do not set TREE_READONLY.
	* tree-flow-inline.h (unmodifiable_var_p): Memory tags never
	represent unmodifiable vars.

	* gcc.dg/torture/pr36244.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr36244.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-flow-inline.h
    trunk/gcc/tree-ssa-alias.c

Comment 7 Richard Biener 2008-05-20 21:04:56 UTC
Subject: Bug 36244

Author: rguenth
Date: Tue May 20 21:03:59 2008
New Revision: 135680

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135680
Log:
2008-05-20  Richard Guenther  <rguenther@suse.de>

	Backport from mainline:
	2008-05-15  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/34330
        * tree-ssa-alias.c (get_smt_for): Only assert that accesses
        through the pointer will alias the SMT.

        * gcc.dg/torture/pr34330.c: New testcase.

        PR middle-end/36244
        * tree-ssa-alias.c (new_type_alias): Do not set TREE_READONLY.
        * tree-flow-inline.h (unmodifiable_var_p): Memory tags never
        represent unmodifiable vars.

        * gcc.dg/torture/pr36244.c: New testcase.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/torture/pr34330.c
      - copied unchanged from r135329, trunk/gcc/testsuite/gcc.dg/torture/pr34330.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/torture/pr36244.c
      - copied unchanged from r135336, trunk/gcc/testsuite/gcc.dg/torture/pr36244.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_3-branch/gcc/tree-flow-inline.h
    branches/gcc-4_3-branch/gcc/tree-ssa-alias.c

Comment 8 Richard Biener 2008-05-20 21:05:01 UTC
Fixed.