This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Your patch for PR 17520
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 10 Nov 2004 13:53:37 -0800
- Subject: Your patch for PR 17520
- Organization: CodeSourcery, LLC
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