This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: [PATCH, 4.0] back port: Make TREE_OVERFLOWed constantgimple_min_invariant


On Sun, 2005-05-15 at 20:27 -0400, Andrew Pinski wrote:
> 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.

not constant, but is_gimple_min_invariant.

>   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?
> 
> Thanks,
> Andrew Pinski
> 
> ChangeLog:
> 
> 	Backport from the mainline:
> 	2005-03-14  Zdenek Dvorak  <dvorakz@suse.cz>
> 
> 	* tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of
> 	integer_zerop.
> 	* tree-gimple.c (is_gimple_min_invariant): Consider overflowed
> 	constants invariant.
> 
> 
> Testcases:
> compile:
> /* Testcase from Dale Johannesen <dalej@gcc.gnu.org>. */
> 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]);
> }
> 
> execute:
> 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]