public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/93447] Value range propagation not working at -Os
       [not found] <bug-93447-4@http.gcc.gnu.org/bugzilla/>
@ 2021-12-17  7:15 ` pinskia at gcc dot gnu.org
  2023-05-06 21:49 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-17  7:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement
   Last reconfirmed|                            |2021-12-17
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Here is a simple testcase which shows the issue even

/* { dg-do compile } */
/* { dg-options "-Os -fdump-tree-optimized" } */
_Bool g(int, int, int *a);

_Bool addb_simple(int A, int B, int *Rp)
{
    int ec=0;
    if(g(A,B,Rp)) 
        ec = -777;
    return !!ec;
}
/* The call to g should be tail called. */
/* { dg-final { scan-tree-dump-times "tail call" 1 "optimized"} } */


PRE for -Os does not do partial redundancy elimination, only code hoisting and
fully redundancy elimination which is why it is not doing it for -Os. What PRE
does not notice is d_5 is not being used so it is fully redundant but I don't
know if PRE/FRE is the right place for this.

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

* [Bug tree-optimization/93447] Value range propagation not working at -Os
       [not found] <bug-93447-4@http.gcc.gnu.org/bugzilla/>
  2021-12-17  7:15 ` [Bug tree-optimization/93447] Value range propagation not working at -Os pinskia at gcc dot gnu.org
@ 2023-05-06 21:49 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-06 21:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |102138

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> The
>   # RANGE [-35, 0] NONZERO 4294967261
>   # d_5 = PHI <0(2), -35(3)>
>   _4 = d_5 != 0;
>   # RANGE [0, 1] NONZERO 1
>   _12 = (int) _4;
>   return _12;
> to:
>   # RANGE [-35, 0] NONZERO 4294967261
>   # d_5 = PHI <0(2), -35(3)>
>   # RANGE [0, 1] NONZERO 1
>   # prephitmp_13 = PHI <0(2), 1(3)>
>   return prephitmp_13;
> optimization is performed by PRE, which is enabled also for -Os, so not sure
> why it doesn't trigger here.
> Richard?

That is basically the same thing as PR 102138 is asking.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102138
[Bug 102138] t = a==0 and a = PHI<0, t> should be done earlier than PRE

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

end of thread, other threads:[~2023-05-06 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93447-4@http.gcc.gnu.org/bugzilla/>
2021-12-17  7:15 ` [Bug tree-optimization/93447] Value range propagation not working at -Os pinskia at gcc dot gnu.org
2023-05-06 21:49 ` 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).