Patchwork [testsuite] Adding target nonpic to g++.dg/tm/pr47746.C

login
register
mail settings
Submitter Alexander Ivchenko
Date April 11, 2013, 9:37 a.m.
Message ID <CACysShhtPuPUsE7ea1QR8R0yihecZgetnec4SnwQ+jL1sY9+Tg@mail.gmail.com>
Download mbox | patch
Permalink /patch/235653/
State New
Headers show

Comments

Alexander Ivchenko - April 11, 2013, 9:37 a.m.
Hi,

The same motivation as for:
http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00786.html

"Since -fpic option is turned on by default in Android we have certain test
fails. The reason for that is that those tests rely on the
availability of functions, defined in them
and with -fpic compiler conservatively assumes that they are
AVAIL_OVERWRITABLE."

In case of tm we have that in here:

4461|   /* If we aren't seeing the final version of the function we don't
4462|      know what it will contain at runtime.  */
4463|   if (cgraph_function_body_availability (node) < AVAIL_AVAILABLE)
4464+>    return true;
4465|

(gdb) p cgraph_function_body_availability (node)
$54 = AVAIL_OVERWRITABLE

and so we have a testfail for Android. The following patch adds nonpic:




is it OK for trunk and for 4.8?

Thanks
Alexander
Patrick Marlier - April 18, 2013, 8:03 a.m.
Hi Alexander,

On Thu, Apr 11, 2013 at 11:37 AM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
> The same motivation as for:
> http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00786.html
>
> "Since -fpic option is turned on by default in Android we have certain test
> fails. The reason for that is that those tests rely on the
> availability of functions, defined in them
> and with -fpic compiler conservatively assumes that they are
> AVAIL_OVERWRITABLE."
>
> In case of tm we have that in here:
>
> 4461|   /* If we aren't seeing the final version of the function we don't
> 4462|      know what it will contain at runtime.  */
> 4463|   if (cgraph_function_body_availability (node) < AVAIL_AVAILABLE)
> 4464+>    return true;
> 4465|
>
> (gdb) p cgraph_function_body_availability (node)
> $54 = AVAIL_OVERWRITABLE
>
> and so we have a testfail for Android.


Where/how does it fails? (backtrace?) I cannot reproduce with -fpic on
linux/x86.

Actually the test is not supposed to fail even with pic. So maybe you
should open a PR.

Thanks,
--
Patrick Marlier
Alexander Ivchenko - May 24, 2013, 7:02 a.m.
*ping*

2013/4/11 Alexander Ivchenko <aivchenk@gmail.com>:
> Hi,
>
> The same motivation as for:
> http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00786.html
>
> "Since -fpic option is turned on by default in Android we have certain test
> fails. The reason for that is that those tests rely on the
> availability of functions, defined in them
> and with -fpic compiler conservatively assumes that they are
> AVAIL_OVERWRITABLE."
>
> In case of tm we have that in here:
>
> 4461|   /* If we aren't seeing the final version of the function we don't
> 4462|      know what it will contain at runtime.  */
> 4463|   if (cgraph_function_body_availability (node) < AVAIL_AVAILABLE)
> 4464+>    return true;
> 4465|
>
> (gdb) p cgraph_function_body_availability (node)
> $54 = AVAIL_OVERWRITABLE
>
> and so we have a testfail for Android. The following patch adds nonpic:
>
> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
> index 943be90..e0a376e 100644
> --- a/gcc/testsuite/ChangeLog
> +++ b/gcc/testsuite/ChangeLog
> @@ -1,3 +1,7 @@
> +2013-04-11  Alexander Ivchenko  <alexander.ivchenko@intel.com>
> +
> +       * g++.dg/tm/pr47746.C: Add target nonpic.
> +
>  2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
>
>         PR c++/54216
> diff --git a/gcc/testsuite/g++.dg/tm/pr47746.C
> b/gcc/testsuite/g++.dg/tm/pr47746.C
> index 7cd9e10..de85a1d 100644
> --- a/gcc/testsuite/g++.dg/tm/pr47746.C
> +++ b/gcc/testsuite/g++.dg/tm/pr47746.C
> @@ -1,4 +1,4 @@
> -// { dg-do compile }
> +// { dg-do compile { target nonpic } }
>  // { dg-options "-fgnu-tm" }
>
>  class InputStream
>
>
>
> is it OK for trunk and for 4.8?
>
> Thanks
> Alexander
Mike Stump - May 24, 2013, 7:44 p.m.
On May 24, 2013, at 12:02 AM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
> *ping*
> 
> 2013/4/11 Alexander Ivchenko <aivchenk@gmail.com>:
>> Hi,
>> 
>> The same motivation as for:
>> http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00786.html
>> 
>> "Since -fpic option is turned on by default in Android we have certain test
>> fails. The reason for that is that those tests rely on the
>> availability of functions, defined in them
>> and with -fpic compiler conservatively assumes that they are
>> AVAIL_OVERWRITABLE."
>> 
>> In case of tm we have that in here:
>> 
>> 4461|   /* If we aren't seeing the final version of the function we don't
>> 4462|      know what it will contain at runtime.  */
>> 4463|   if (cgraph_function_body_availability (node) < AVAIL_AVAILABLE)
>> 4464+>    return true;
>> 4465|
>> 
>> (gdb) p cgraph_function_body_availability (node)
>> $54 = AVAIL_OVERWRITABLE

So, normally I would just approve it.  This is the last chance to answer the question, is that reasonable?

So, I'd like a linker/cgraph person to say, yes, indeed, that is reasonable.  If yes, then Ok.

I can't help but think that merely having -fpic doesn't actually change something like linkage or the fact something is, or is not defined.

Patch

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 943be90..e0a376e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@ 
+2013-04-11  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+       * g++.dg/tm/pr47746.C: Add target nonpic.
+
 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/54216
diff --git a/gcc/testsuite/g++.dg/tm/pr47746.C
b/gcc/testsuite/g++.dg/tm/pr47746.C
index 7cd9e10..de85a1d 100644
--- a/gcc/testsuite/g++.dg/tm/pr47746.C
+++ b/gcc/testsuite/g++.dg/tm/pr47746.C
@@ -1,4 +1,4 @@ 
-// { dg-do compile }
+// { dg-do compile { target nonpic } }
 // { dg-options "-fgnu-tm" }

 class InputStream