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]

Your patch for PR 17520


Sebastian --

I've reveiewed some of your outstanding patches:

1) http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00932.html

OK. In fact, I'd call that one "obvious".

2) http://gcc.gnu.org/ml/gcc-patches/2004-10/msg01592.html

I find the existing check for element_size being non-NULL, and the new check you added that it is an INTEGER_CST to be odd. Can we really have an array whose elements are not of a constant size? I didn't think that was allowed even in C99. I'm not sure about other languages, or how they are supposed to simplify things before the middle-end sees that.

The array_size part of the patch is clearly OK, so please go ahead with that. I think I'd prefer an assert for the element_size part, or you can just leave it out. I don't think it's need to fix the PR. Correct?

3) http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00192.html

Oh, fun with math. :-)

! 		      /* At this point (x0, y0) is one of the
! 			 solutions to the Diophantine equation.  The
! 			 next step has to compute the smallest
! 			 positive solution: the first conflicts.  */
! 		      while ((x0 - i1) >= 0 && (y0 - j1) >= 0)
! 			{
! 			  x0 -= i1;
! 			  y0 -= j1;
! 			}

Can't we do this more efficiently than repeated subtraction? Something like:

 max_multiple = max (x0 / i1, y0 / j1);
 x0 -= i1 * max_multiple;
 y0 -= j1 * max_multiple;

OK with that change.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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