This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, 4.0] back port: Make TREE_OVERFLOWed constant gimple_min_invariant

A couple of bug reports were filed which showed that this patch is really
needed on the 4.0 branch also. The first testcase comes from a f2c
compiler and shows that we will ICE in PRE because PRE assumes
(correctly) that all INTEGER_CST are constants. The second testcase
comes unknown and shows that we still can get TREE_OVERFLOW INTEGER_CST
when we get to find_taken_edge_cond_expr.

This is the backport from the mainline and has been bootstrapped and tested
on x86_64-pc-linux-gnu (Thanks Steven) with no regressions.

OK for the 4.0 branch?

Andrew Pinski


	Backport from the mainline:
	2005-03-14  Zdenek Dvorak  <>

	* tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of
	* tree-gimple.c (is_gimple_min_invariant): Consider overflowed
	constants invariant.

Attachment: t.diff.txt
Description: Text document

/* Testcase from Dale Johannesen <>. */
struct {
double x[1];
} g;
void k( double *, double*);
void h(int Tmp8)
  int i;
  for(i = 1;i <= Tmp8;i++)
    k(&g.x[ + -1],&g.x[ Tmp8 + -1]);

void abort (void);

int bar (void) { return -1; }

unsigned long
foo ()
{ unsigned long retval;
  retval = bar ();
  if (retval == -1)  return 0;
  return 3;  }

main ()
{ if (foo () != 0)  abort ();
  return 0;  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]