[PATCH] Fix artificial overflow during GENERIC folding
Eric Botcazou
botcazou@adacore.com
Wed May 24 14:41:05 GMT 2023
> 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.
--
Eric Botcazou
More information about the Gcc-patches
mailing list