Bug 33140 - [4.3 Regression] ICE in build2_stat, at tree.c:3115
Summary: [4.3 Regression] ICE in build2_stat, at tree.c:3115
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.0
: P1 normal
Target Milestone: 4.3.0
Assignee: Andrew Pinski
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-08-21 21:01 UTC by Martin Michlmayr
Modified: 2007-10-13 19:35 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-08-29 20:41:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2007-08-21 21:01:06 UTC
I'm getting the following ICE with current trunk.  This appeared between
20070720 and 20070811.

(sid)25830:tbm@em64t: ~] /usr/lib/gcc-snapshot/bin/gcc -c -O2 pari-base1.c
pari-base1.c: In function 'initzeta':
pari-base1.c:42: internal compiler error: in build2_stat, at tree.c:3115
Please submit a full bug report,
with preprocessed source if appropriate.
Comment 1 Martin Michlmayr 2007-08-21 21:03:07 UTC
Maybe caused by this change?

2008-08-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>
Comment 2 Martin Michlmayr 2007-08-21 21:03:41 UTC
typedef long unsigned int size_t;
typedef struct
{
}
ldiv_t;
typedef unsigned long int ulong;
enum
{
  t_INT = 1, t_REAL = 2, t_INTMOD = 3, t_FRAC = 4, t_COMPLEX = 6, t_PADIC =
    15, t_QFI = 16, t_VEC = 17, t_COL = 18, t_MAT = 19, t_LIST = 20, t_STR =
    21, t_VECSMALL = 22
};
typedef long *GEN;
typedef ulong pari_sp;
extern pari_sp avma, bot, top;
GEN gerepileuptoleaf (pari_sp av, GEN q);
GEN mulir (GEN x, GEN y);
GEN mulrr (GEN x, GEN y);
__inline__ static GEN
new_chunk (size_t x)
{
  const GEN z = ((GEN) avma) - x;
  return z;
}
__inline__ static GEN
cgetg (long x, long y)
{
  const GEN z = new_chunk ((size_t) x);
  return z;
}
mpadd (GEN x, GEN y)
{
}
__inline__ static GEN
mpmul (GEN x, GEN y)
{
  return (((long) ((((ulong *) (y))[0]) >> ((1L << (3 + 3)) - 7))) ==
          t_INT) ? mulir (y, x) : mulrr (x, y);
}
GEN checkbnf_i (GEN bnf);
initzeta (GEN pol, long prec)
{
  GEN nfz, nf, gr1, gr2, gru, p1, p2, cst, coef, bnf = checkbnf_i (pol);
  GEN limx, resi, zet, C, coeflog, racpi, aij, tabj, colzero, *tabcstn,
    *tabcstni;
  long N0, i0, r1, r2, r, R, N, i, j, k, n, bit =
    (((prec) - 2) << (3 + 3)) + 6;
  pari_sp av, av2;
  C = cgetg (r + 1, t_MAT);
    {
      GEN aiji = (((GEN *) (aij))[i]);
      for (k = 1; k <= r; k++)
        {
              {
                GEN tabjn = (((GEN *) (tabj))[n]), p2 =
                  mpmul ((((GEN *) (aiji))[1 + k]), (((GEN *) (tabjn))[1]));
                for (j = 2; j <= r - k + 1; j++)
                    mpadd (p2,
                           mpmul ((((GEN *) (aiji))[j + k]),
                                  (((GEN *) (tabjn))[j])));
              }
          (((GEN **) (C))[k][i]) = gerepileuptoleaf (av2, p1);
        }
    }
}
Comment 3 Andrew Pinski 2007-08-29 00:37:17 UTC
(In reply to comment #1)
> Maybe caused by this change?

No it could not have been caused by that as it made the assert weaker, not stronger :).
Comment 4 Andrew Pinski 2007-08-29 00:45:13 UTC
By the way, the ICE in build2_stat are very very target dependent because of IV-OPTs.
Comment 5 Andrew Pinski 2007-08-29 01:00:09 UTC
Was caused by:
2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/32399
        * tree-ssa-address.c (add_to_parts): Use POINTER_PLUS_EXPR
        when adding to the base and convert ELT to sizetype instead of type.
Comment 6 Andrew Pinski 2007-08-29 20:41:06 UTC
Mine, working on it.
Comment 7 Jakub Jelinek 2007-09-19 12:55:13 UTC
This no longer reproduces on the trunk since
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128272
Comment 8 Andrew Pinski 2007-10-13 19:35:06 UTC
Fixed.