[patch] Fix type consistency problem in tree-tailcall.c
Richard Guenther
richard.guenther@gmail.com
Wed Nov 3 11:04:00 GMT 2010
On Wed, Nov 3, 2010 at 11:26 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> the attached testcase exhibits a regression present at -O2 on the mainline
> with checking enabled:
>
> /home/eric/svn/gcc/gcc/testsuite/gnat.dg/opt8.adb:25:5: error: type mismatch
> in binary expression
> natural___XDLU_0__2147483647
> const integer
> natural___XDLU_0__2147483647
> D.2693_51 = R3b_27 + add_acc.25_49;
> +===========================GNAT BUG DETECTED==============================+
> | 4.6.0 20101102 (experimental) [trunk revision 166172] (i586-suse-linux-gnu)
> GCC error:|
> | verify_stmts failed |
> | Error detected
> around /home/eric/svn/gcc/gcc/testsuite/gnat.dg/opt8.adb:25:5|
>
>
> The problem is that, while the code to discover tail calls knows how to look
> through casts, it doesn't reinstate them when it is building expressions to
> compute the accumulator and multiplicator values. Hence the attached patch.
>
> Tested on i586-suse-linux, OK for the mainline?
Ok.
Thanks,
Richard.
>
> 2010-11-03 Eric Botcazou <ebotcazou@adacore.com>
>
> * tree-tailcall.c (find_tail_calls): Convert the operands to the type
> of the result before building binary expressions.
>
>
> 2010-11-03 Eric Botcazou <ebotcazou@adacore.com>
>
> * gnat.dg/opt8.ad[sb]: New test.
> * gnat.dg/opt8_pkg.ads: New helper.
>
>
> --
> Eric Botcazou
>
More information about the Gcc-patches
mailing list