[Bug target/20802] mmix-knuth-mmixware testsuite failure: gcc.dg/builtin-apply4.c execution
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 8 03:26:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20802
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
Known to work| |4.1.0
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=20076
Known to fail| |3.4.0, 4.2.0, 4.3.0
--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Rob from comment #7)
> I tried this on i686-pc-linux-gnu using gcc-3.4 (from Debian), gcc-4.1 (from
> Debian), gcc version 4.2.0 20070501 (prerelease) (from SVN), and gcc version
> 4.3.0 20070607 (experimental) (from SVN):
>
> I modified as follows:
>
> /* PR tree-optimization/20076 */
> /* { dg-options "-O2" } */
> /* { dg-do run } */
>
> extern void abort (void);
>
> double
> foo (int arg)
> {
> printf("foo1 - arg = %u \n", arg);
> if (arg != 116)
> abort();
> printf("foo2 - arg = %u \n", arg);
> return arg + 1;
> }
>
> inline double
> bar (int arg)
> {
> printf("bar1 - arg = %u \n", arg);
> foo (arg);
> printf("bar2 - arg = %u \n", arg);
> __builtin_return (__builtin_apply ((void (*) ()) foo, __builtin_apply_args
> (), 128));
> __builtin_return (__builtin_apply ((void (*) ()) foo, __builtin_apply_args
> (), 32));
> __builtin_return (__builtin_apply ((void (*) ()) foo, __builtin_apply_args
> (), 16));
> printf("bar3 - arg = %u \n", arg);
> }
>
> int
> main (int argc, char **argv)
> {
> printf("main1 - pre bar\n");
> if (bar (116) != 117.0) {
> printf("main2 - post bar - abort\n");
> abort ();
> }
> printf("main2 - post bar - no abort\n");
> return 0;
> }
>
>
> The printf statments are the only changes, everything else is the same as
> 4.3.0.
>
> Here is what the .exe's print for each version of gcc:
>
> # ./builtin-apply4_gcc3.4.exe
> main1 - pre bar
> bar1 - arg = 116
> foo1 - arg = 116
> foo2 - arg = 116
> bar2 - arg = 116
> foo1 - arg = 1
> Aborted
>
> # ./builtin-apply4_gcc4.1.exe
> main1 - pre bar
> bar1 - arg = 116
> foo1 - arg = 116
> foo2 - arg = 116
> bar2 - arg = 116
> foo1 - arg = 116
> foo2 - arg = 116
> main2 - post bar - no abort
>
> # ./builtin-apply4_gcc4.2.exe
> main1 - pre bar
> bar1 - arg = 116
> foo1 - arg = 116
> foo2 - arg = 116
> bar2 - arg = 116
> foo1 - arg = 116
> foo2 - arg = 116
> main2 - post bar - abort
> Aborted
>
> # ./builtin-apply4_4.3.exe
> main1 - pre bar
> bar1 - arg = 116
> foo1 - arg = 116
> foo2 - arg = 116
> bar2 - arg = 116
> foo1 - arg = 116
> foo2 - arg = 116
> main2 - post bar - abort
> Aborted
>
>
> GCC 3.4 prints "foo1 - arg = 1" - which is way off.
>
> GCC 4.1 prints "main2 - post bar - no abort" - which means it is OK
>
> The others are incorrect. I do not have 4.0.0 to confirm this report but you
> might says it was fixed in 4.1 - only to re-occur in later versions :( .
>
> I'd change the known to fail field but I don't have permission.
I changed it for you.
More information about the Gcc-bugs
mailing list