public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/77899] incorrect VR_RANGE for a signed char function argument
       [not found] <bug-77899-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-10  4:31 ` pinskia at gcc dot gnu.org
  2021-09-06 11:32 ` pinskia at gcc dot gnu.org
  2023-05-16  2:42 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-10  4:31 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=94356
           Severity|normal                      |enhancement

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We just don't fold ptr < ptr that well:
  _1 = (sizetype) i_5(D);
  p_6 = &d[1] + _1;
  if (&MEM <char[3]> [(void *)&d + 1B] > p_6)

If we change d to be a pointer argument we get:
  p_5 = d_4(D) + 1;
  _1 = (sizetype) i_6(D);
  _10 = _1 + 1;
  p_7 = d_4(D) + _10;
  if (p_5 > p_7)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

But that is PR 94356 (well if change pointer from type char to being int or
something different).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/77899] incorrect VR_RANGE for a signed char function argument
       [not found] <bug-77899-4@http.gcc.gnu.org/bugzilla/>
  2021-08-10  4:31 ` [Bug tree-optimization/77899] incorrect VR_RANGE for a signed char function argument pinskia at gcc dot gnu.org
@ 2021-09-06 11:32 ` pinskia at gcc dot gnu.org
  2023-05-16  2:42 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-06 11:32 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-09-06
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  p_6 = &d[130] + _1;
  if (&MEM <char[260]> [(void *)&d + 2B] > p_6)

Even this should be folded but is not currently:
void f (signed char i)
{
  char d [260];

  const char *p = &d[130];

  p += i;

  if (p == d + 2 || d + 257 == p)
    __builtin_abort ();
}


I am thinking ptr_difference_const is not able to handle &MEM <char[260]>
[(void *)&d + 2B] correctly.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/77899] incorrect VR_RANGE for a signed char function argument
       [not found] <bug-77899-4@http.gcc.gnu.org/bugzilla/>
  2021-08-10  4:31 ` [Bug tree-optimization/77899] incorrect VR_RANGE for a signed char function argument pinskia at gcc dot gnu.org
  2021-09-06 11:32 ` pinskia at gcc dot gnu.org
@ 2023-05-16  2:42 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-16  2:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=107699

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #12)
> Even this should be folded but is not currently:
> void f (signed char i)
> {
>   char d [260];
> 
>   const char *p = &d[130];
> 
>   p += i;
> 
>   if (p == d + 2 || d + 257 == p)
>     __builtin_abort ();
> }

That was handled by r13-4555-g892e8c520be37d (aka PR 107699).

The non eq/ne ones are not handled though; I think there might be another bug
about that ...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-16  2:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-77899-4@http.gcc.gnu.org/bugzilla/>
2021-08-10  4:31 ` [Bug tree-optimization/77899] incorrect VR_RANGE for a signed char function argument pinskia at gcc dot gnu.org
2021-09-06 11:32 ` pinskia at gcc dot gnu.org
2023-05-16  2:42 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).