On Wed, May 24, 2023 at 4:41 PM Eric Botcazou <botca...@adacore.com> wrote: > > > But nobody is going to understand why the INTEGER_CST case goes the > > other way. > > I can add a fat comment to that effect of course. :-) > > > As you say we don't have a good way to say we're doing > > this to avoid undefined behavior, but then a view-convert back would > > be a good way to indicate that? I can't come up with a better name > > for a custom operator we could also use, > > > > (convert_without_overflow (negate (convert:utype @1)))) > > > > maybe? As said, if view_convert works I prefer that. Does it? > > Well, VIEW_CONVERT_EXPR adds its own set of problems in GENERIC and it will > precisely survive when it is not needed, so I'm not sure that's any better.
I guess there's no ideal way to achieve what we want here. Let's go with your patch but with a comment before the INTEGER_CST check. Thanks, Richard. > -- > Eric Botcazou > >