On 12/27/2017 01:16 AM, Tom de Vries wrote: > On 12/21/2017 06:19 PM, Cesar Philippidis wrote: >> My test results are somewhat inconsistent. On MG's build servers, there >> are no regressions in CUDA 8. > > Ack. > >> On my laptop, there are fewer regressions >> in CUDA 9, than CUDA 8. > > If the patch causes regressions for either cuda 8 or cuda 9, then they > need to be analyzed and fixed. > > Please clarify what you think it means if in one case there are less > regressions than in the other. > >> However, I think some of those failures are due >> to premature timeouts on my laptop (I'm setting dejagnu to timeout after >> 90s instead of 5m locally). > > If you have flawed test results due to a local change you made, you need > to undo the local change and rerun the test, and report the sane test > results instead of reporting flawed test results. > >> I know your on vacation, so I'll commit this patch to og7. We can >> revisit the patch for trunk and other backports later. > > If you don't have time to do the testing now, then please file a PR for > this issue and attach the patch with the updates that address my comments.
Sorry for taking so long to respond. I finally had a chance to analyze the results. There are no regressions with this patch. In fact, using the unpatched CUDA8 build as a baseline, after the CUDA9 patch, 66 additional tests pass in CUDA 8 and 73 tests additional tests pass in CUDA 9. Is this patch OK for trunk? Cesar
2017-12-19 Cesar Philippidis <ce...@codesourcery.com> gcc/ * config/nvptx/nvptx.c (output_init_frag): Don't use generic address spaces for function labels. gcc/testsuite/ * gcc.target/nvptx/indirect_call.c: New test. diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index dfb27ef..a7b4c09 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -1894,9 +1894,15 @@ output_init_frag (rtx sym) if (sym) { - fprintf (asm_out_file, "generic("); + bool function = SYMBOL_REF_DECL (sym) + && (TREE_CODE (SYMBOL_REF_DECL (sym)) == FUNCTION_DECL); + if (!function) + fprintf (asm_out_file, "generic("); output_address (VOIDmode, sym); - fprintf (asm_out_file, val ? ") + " : ")"); + if (!function) + fprintf (asm_out_file, val ? ") + " : ")"); + else if (val) + fprintf (asm_out_file, " + "); } if (!sym || val) diff --git a/gcc/testsuite/gcc.target/nvptx/indirect_call.c b/gcc/testsuite/gcc.target/nvptx/indirect_call.c new file mode 100644 index 0000000..39992a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/indirect_call.c @@ -0,0 +1,19 @@ +/* { dg-options "-O2 -msoft-stack" } */ +/* { dg-do run } */ + +int +f1 (int a) +{ + return a + 1; +} + +int (*f2)(int) = f1; + +int +main () +{ + if (f2 (100) != 101) + __builtin_abort(); + + return 0; +}