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: Unreviewed patch (expand_expr:MINUS_EXPR)


"Ulrich Weigand" <Ulrich.Weigand@de.ibm.com> writes:

> Could someone please have a look at this patch:
> 
> http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01072.html

[that refers to an original patch by Jason:]
>> http://gcc.gnu.org/ml/gcc-patches/1999-10n/msg00071.html

I think it'd be better to fix Jason's original patch; there's no reason
why this can't be done at the tree level.

I was looking at the original explanation for Jason's patch,
and have come to two conclusions:

1. It would really have helped if there were more testcases.  Jason,
   do you remember what specifically broke?  Ulrich, can you make up a
   testcase for the optimisation you're missing (perhaps using
   scan-assembler)?

2. I don't understand Jason's original patch.  If you negate something
   in a POINTER_TYPE, it should be what you'd expect: the value which,
   when added to another POINTER_TYPE value, is equivalent to
   subtracting the original thing.  If that doesn't happen then negation
   is broken.

I think this might be something which was really fixed later by the
application of stricter rules about the sign-extension of CONST_INTs,
and so the right thing is to just back out Jason's original patch
(with some minor changes, signed_type is now a language hook).

Any other opinions?

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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