This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ancient wrong-code with ?: (PR middle-end/81814)
On Thu, 31 Aug 2017, Eric Botcazou wrote:
> > So you should be able to extract a C testcase? I suspect sth like
> >
> > long foo (long x, int y)
> > {
> > return y > x ? y : x;
> > }
> >
> > to no longer be folded to return MAX_EXPR (x, (long) y).
> >
> > That would be a shame btw.
Just checked and the above is still folded.
> Any news on this? We're having regressions in Ada because of that, e.g.
>
> for U'Object_Size use 17179869280;
> -for U'Value_Size use (((((#1 max 0) + 11) & -4) + 4) * 8) ;
> +for U'Value_Size use (((((if (#1 > 0) then #1 else 0 end) + 11) & -4) + 4)
> * 8) ;
> for U'Alignment use 4;
>
> which means that COND_EXPR is no longer turned into MAX_EXPR in TYPE_SIZE.
Can you file a bugreport and include a testcase for gnat.dg so that
we can reproduce? Bonus points if you manage to create a C testcase
of course ;)
Richard.