[lto] Add test case for previous failure

Andrew Thomas Pinski pinskia@gmail.com
Mon Jan 12 18:09:00 GMT 2009



On Jan 12, 2009, at 9:02 AM, Diego Novillo <dnovillo@google.com> wrote:

>
> This test used to fail when compiled with LTO enabled with:
>
> 20090112_0.C: In function 'const char* func(int)':
> 20090112_0.C:10: internal compiler error: vector
> VEC(constructor_elt,base) push domain error, in build_constructors  
> at tree-switch-conversion.c:450
>
> Fixed by the latest merge from trunk.
>

Actually this failed even without lto enabled and there is a testcase  
in the testsuite already. I had fixed the bug here where the integer  
const would wrap so there would have been an
Infinite loop in switch conversion.

Thanks,
Andrew Pinski
PS it is most likely better to use __INT_MAX__ than it is to use the  
integer constant here.



>
> Diego.
>
>
>
>    * g++.dg/lto/20090112_0.C: New.
>
> Index: g++.dg/lto/20090112_0.C
> ===================================================================
> --- g++.dg/lto/20090112_0.C    (revision 0)
> +++ g++.dg/lto/20090112_0.C    (revision 0)
> @@ -0,0 +1,11 @@
> +// { dg-do run }
> +const char *func(int val) {
> + switch (val) {
> +   case 2147483647: return "foo";
> +   default: return "";
> + }
> +}
> +
> +int main() {
> + return 0;
> +}



More information about the Gcc-patches mailing list