https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #28 from H.J. Lu <hjl.tools at gmail dot com> ---

(In reply to Andrew Pinski from comment #27)
> This patch breaks ILP32 with stack pointers.
> For this function:
> void f(int *a, int b, long long d) __attribute__((noinline,noclone));
> void f(int *a, int b, long long d)
> {
>    if((0x6ffffeff - b) < 11)
>      a[(0x6ffffeff - b) +34+0+16+3+12] = d;
> }
> 
> If a is 0xfffefe90 we get an invalid overflow.  We have the following RTL to
> begin with:
> (plus:SI (plus:SI (mult:SI (reg/v:SI 80 [ b ])
>             (const_int -4 [0xfffffffffffffffc]))
>         (subreg/s/u:SI (reg/v/f:DI 79 [ a ]) 0))
>     (const_int -1073742592 [0xffffffffbffffd00]))
> 
> And we decide to put the constant in DImode rather than SImode.

There is an address overflow and you want to truncate it to 32-bit.
I am not sure if it is defined.

Reply via email to