public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Straw poll on shifts with out of range operands
@ 2024-06-26  2:44 Andrew Pinski
  2024-06-26  2:57 ` Jeff Law
  2024-06-29 13:50 ` IFNDR on UB? [was: Straw poll on shifts with out of range operands] Matthias Kretz
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Pinski @ 2024-06-26  2:44 UTC (permalink / raw)
  To: GCC Mailing List

I am in the middle of improving the isolation path pass for shifts
with out of range operands.
There are 3 options we could do really:
1) isolate the path to __builtin_unreachable
2) isolate the path to __builtin_trap
    This is what is currently done for null pointer and divide by zero
3) isolate the path and turn the shift into zero constant
   This happens currently for explicit use in both match (in many
cases) and VRP for others.

All 3 are not hard to implement.
This comes up in the context of https://gcc.gnu.org/PR115636 where the
original requestor thinks it should be #3 but I suspect they didn't
realize it was undefined behavior then.
2 seems the best for user experience.
1 seems like the best for optimizations.
3 is more in line with how other parts of the compiler handle it.

So the question I have is which one should we go for? (is there
another option I missed besides not do anything)

Thanks,
Andrew Pinski

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

end of thread, other threads:[~2024-06-30  6:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  2:44 Straw poll on shifts with out of range operands Andrew Pinski
2024-06-26  2:57 ` Jeff Law
2024-06-26  6:46   ` Richard Biener
2024-06-29 13:50 ` IFNDR on UB? [was: Straw poll on shifts with out of range operands] Matthias Kretz
2024-06-29 14:20   ` Martin Uecker
2024-06-30  3:03     ` Matthias Kretz
2024-06-30  6:33       ` Martin Uecker
2024-06-30  6:56         ` Martin Uecker

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).