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 0/2] Introduce gcc_qsort


On Fri, 11 May 2018, Segher Boessenkool wrote:
> For example from reload1.c:

No, this example is not relevant, because ...

> static int
> reload_reg_class_lower (const void *r1p, const void *r2p)
> {
>   int r1 = *(const short *) r1p, r2 = *(const short *) r2p;
> 
> // ...
> 
>   return r1 - r2;

this subtracts integers, not pointers.

In general such address-based comparisons steps are invalid; they lack
anti-reflexivity. So comparators are not actually allowed to do that.

Alexander


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