public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
@ 2014-10-20 17:42 Sriraman Tallam
  2014-10-20 17:46 ` Xinliang David Li
  0 siblings, 1 reply; 10+ messages in thread
From: Sriraman Tallam @ 2014-10-20 17:42 UTC (permalink / raw)
  To: GCC Patches, David Li; +Cc: Jan Hubicka, Cary Coutant, Paul Pluzhnikov

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

Hi,

   This patch is under review for trunk GCC :
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.

    In the mean time, is this ok for google/gcc-4_9 branch?  Without
this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
boundary.

Thanks
Sri

[-- Attachment #2: pr63538.txt --]
[-- Type: text/plain, Size: 1179 bytes --]

Index: testsuite/gcc.dg/pr63538.c
===================================================================
--- testsuite/gcc.dg/pr63538.c	(revision 0)
+++ testsuite/gcc.dg/pr63538.c	(revision 0)
@@ -0,0 +1,14 @@
+/* PR63538 is about not using 64-bit addresses for .lrodata accesses when it
+   involves STRING_CSTs.  */
+/* { dg-do compile { target x86_64-*-* } } */
+/* { dg-options "-O2 -mcmodel=medium -mlarge-data-threshold=0" { target x86_64-*-* } } */
+
+#include <stdio.h>
+
+const char *str = "Hello World";
+
+int main() {
+ printf("str = %p %s\n",str, str);
+ return 0;
+}
+/* { dg-final { scan-assembler-not "movl" } } */
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 216287)
+++ config/i386/i386.c	(working copy)
@@ -41331,8 +41331,7 @@ ix86_encode_section_info (tree decl, rtx rtl, int
 {
   default_encode_section_info (decl, rtl, first);
 
-  if (TREE_CODE (decl) == VAR_DECL
-      && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
+  if ((TREE_STATIC (decl) || DECL_EXTERNAL (decl))
       && ix86_in_large_data_p (decl))
     SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_FAR_ADDR;
 }

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 17:42 [Google/gcc-4_9][PATCH][target/x86_64] PR 63538 Sriraman Tallam
@ 2014-10-20 17:46 ` Xinliang David Li
  2014-10-20 17:51   ` Sriraman Tallam
  0 siblings, 1 reply; 10+ messages in thread
From: Xinliang David Li @ 2014-10-20 17:46 UTC (permalink / raw)
  To: Sriraman Tallam; +Cc: GCC Patches, Jan Hubicka, Cary Coutant, Paul Pluzhnikov

Why removing the tree_code check?

David

On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
> Hi,
>
>    This patch is under review for trunk GCC :
> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>
>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
> boundary.
>
> Thanks
> Sri

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 17:46 ` Xinliang David Li
@ 2014-10-20 17:51   ` Sriraman Tallam
  2014-10-20 17:58     ` Andrew Pinski
  2014-10-20 18:05     ` Xinliang David Li
  0 siblings, 2 replies; 10+ messages in thread
From: Sriraman Tallam @ 2014-10-20 17:51 UTC (permalink / raw)
  To: Xinliang David Li; +Cc: GCC Patches, Jan Hubicka, Cary Coutant, Paul Pluzhnikov

On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
> Why removing the tree_code check?

The actual problem happens because STRING_CSTs (end up in .lrodata)
are not set a far address as they dont match the VAR_DECL check here.
Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
right thing so this seems unnecessary & buggy here.

Thanks
Sri

>
> David
>
> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>> Hi,
>>
>>    This patch is under review for trunk GCC :
>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>
>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>> boundary.
>>
>> Thanks
>> Sri

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 17:51   ` Sriraman Tallam
@ 2014-10-20 17:58     ` Andrew Pinski
  2014-10-20 19:09       ` Sriraman Tallam
  2014-10-20 18:05     ` Xinliang David Li
  1 sibling, 1 reply; 10+ messages in thread
From: Andrew Pinski @ 2014-10-20 17:58 UTC (permalink / raw)
  To: Sriraman Tallam
  Cc: Xinliang David Li, GCC Patches, Jan Hubicka, Cary Coutant,
	Paul Pluzhnikov

On Mon, Oct 20, 2014 at 10:46 AM, Sriraman Tallam <tmsriram@google.com> wrote:
> On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
>> Why removing the tree_code check?
>
> The actual problem happens because STRING_CSTs (end up in .lrodata)
> are not set a far address as they dont match the VAR_DECL check here.
> Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
> right thing so this seems unnecessary & buggy here.

I think he is asking because TREE_STATIC (decl) || DECL_EXTERNAL
(decl) might be an issue for STRING_CSTs.

Thanks,
Andrew


>
> Thanks
> Sri
>
>>
>> David
>>
>> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>> Hi,
>>>
>>>    This patch is under review for trunk GCC :
>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>>
>>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>>> boundary.
>>>
>>> Thanks
>>> Sri

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 17:51   ` Sriraman Tallam
  2014-10-20 17:58     ` Andrew Pinski
@ 2014-10-20 18:05     ` Xinliang David Li
  2014-10-20 18:59       ` Sriraman Tallam
  1 sibling, 1 reply; 10+ messages in thread
From: Xinliang David Li @ 2014-10-20 18:05 UTC (permalink / raw)
  To: Sriraman Tallam; +Cc: GCC Patches, Jan Hubicka, Cary Coutant, Paul Pluzhnikov

Perhaps explicitly allowing STRING_CST to go through the large data
check, instead of removing the var-decl check? Do you see other
opcodes that need to be handled too?

David

On Mon, Oct 20, 2014 at 10:46 AM, Sriraman Tallam <tmsriram@google.com> wrote:
> On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
>> Why removing the tree_code check?
>
> The actual problem happens because STRING_CSTs (end up in .lrodata)
> are not set a far address as they dont match the VAR_DECL check here.
> Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
> right thing so this seems unnecessary & buggy here.
>
> Thanks
> Sri
>
>>
>> David
>>
>> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>> Hi,
>>>
>>>    This patch is under review for trunk GCC :
>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>>
>>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>>> boundary.
>>>
>>> Thanks
>>> Sri

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 18:05     ` Xinliang David Li
@ 2014-10-20 18:59       ` Sriraman Tallam
  0 siblings, 0 replies; 10+ messages in thread
From: Sriraman Tallam @ 2014-10-20 18:59 UTC (permalink / raw)
  To: Xinliang David Li; +Cc: GCC Patches, Jan Hubicka, Cary Coutant, Paul Pluzhnikov

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

On Mon, Oct 20, 2014 at 10:59 AM, Xinliang David Li <davidxl@google.com> wrote:
> Perhaps explicitly allowing STRING_CST to go through the large data
> check, instead of removing the var-decl check? Do you see other
> opcodes that need to be handled too?

I do not see any other opcodes explicitly but the code in
ix86_in_large_data_p seemingly handles all opcodes other than
FUNCTION_DECL through:

if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
    {
        <blah>
    }
else {
    <blah>
  }


However, I have modified the patch to explicitly check for STRING_CST
and I cannot think of any other case where the constant goes into
rodata but is not accessed via a VAR_DECL. Also note that TREE_STATIC
(decl) is true for STRING_CST.

Thanks
Sri




>
> David
>
> On Mon, Oct 20, 2014 at 10:46 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>> On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
>>> Why removing the tree_code check?
>>
>> The actual problem happens because STRING_CSTs (end up in .lrodata)
>> are not set a far address as they dont match the VAR_DECL check here.
>> Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
>> right thing so this seems unnecessary & buggy here.
>>
>> Thanks
>> Sri
>>
>>>
>>> David
>>>
>>> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>> Hi,
>>>>
>>>>    This patch is under review for trunk GCC :
>>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>>>
>>>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>>>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>>>> boundary.
>>>>
>>>> Thanks
>>>> Sri

[-- Attachment #2: pr63538.txt --]
[-- Type: text/plain, Size: 1196 bytes --]

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 216287)
+++ config/i386/i386.c	(working copy)
@@ -41331,7 +41331,7 @@ ix86_encode_section_info (tree decl, rtx rtl, int
 {
   default_encode_section_info (decl, rtl, first);
 
-  if (TREE_CODE (decl) == VAR_DECL
+  if ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == STRING_CST)
       && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
       && ix86_in_large_data_p (decl))
     SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_FAR_ADDR;
Index: testsuite/gcc.dg/pr63538.c
===================================================================
--- testsuite/gcc.dg/pr63538.c	(revision 0)
+++ testsuite/gcc.dg/pr63538.c	(revision 0)
@@ -0,0 +1,14 @@
+/* PR63538 is about not using 64-bit addresses for .lrodata accesses when it
+   involves STRING_CSTs.  */
+/* { dg-do compile { target x86_64-*-* } } */
+/* { dg-options "-O2 -mcmodel=medium -mlarge-data-threshold=0" { target x86_64-*-* } } */
+
+#include <stdio.h>
+
+const char *str = "Hello World";
+
+int main() {
+ printf("str = %p %s\n",str, str);
+ return 0;
+}
+/* { dg-final { scan-assembler-not "movl" } } */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 17:58     ` Andrew Pinski
@ 2014-10-20 19:09       ` Sriraman Tallam
  2014-10-20 20:10         ` Xinliang David Li
  0 siblings, 1 reply; 10+ messages in thread
From: Sriraman Tallam @ 2014-10-20 19:09 UTC (permalink / raw)
  To: Andrew Pinski
  Cc: Xinliang David Li, GCC Patches, Jan Hubicka, Cary Coutant,
	Paul Pluzhnikov

On Mon, Oct 20, 2014 at 10:51 AM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Mon, Oct 20, 2014 at 10:46 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>> On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
>>> Why removing the tree_code check?
>>
>> The actual problem happens because STRING_CSTs (end up in .lrodata)
>> are not set a far address as they dont match the VAR_DECL check here.
>> Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
>> right thing so this seems unnecessary & buggy here.
>
> I think he is asking because TREE_STATIC (decl) || DECL_EXTERNAL
> (decl) might be an issue for STRING_CSTs.

TREE_STATIC is true for STRING_CSTs and DECL_EXTERNAL false, that looks ok.

Thanks
Sri

>
> Thanks,
> Andrew
>
>
>>
>> Thanks
>> Sri
>>
>>>
>>> David
>>>
>>> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>> Hi,
>>>>
>>>>    This patch is under review for trunk GCC :
>>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>>>
>>>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>>>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>>>> boundary.
>>>>
>>>> Thanks
>>>> Sri

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 19:09       ` Sriraman Tallam
@ 2014-10-20 20:10         ` Xinliang David Li
  2014-10-20 20:46           ` Sriraman Tallam
  0 siblings, 1 reply; 10+ messages in thread
From: Xinliang David Li @ 2014-10-20 20:10 UTC (permalink / raw)
  To: Sriraman Tallam
  Cc: Andrew Pinski, GCC Patches, Jan Hubicka, Cary Coutant, Paul Pluzhnikov

On Mon, Oct 20, 2014 at 11:59 AM, Sriraman Tallam <tmsriram@google.com> wrote:
> On Mon, Oct 20, 2014 at 10:51 AM, Andrew Pinski <pinskia@gmail.com> wrote:
>> On Mon, Oct 20, 2014 at 10:46 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>> On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
>>>> Why removing the tree_code check?
>>>
>>> The actual problem happens because STRING_CSTs (end up in .lrodata)
>>> are not set a far address as they dont match the VAR_DECL check here.
>>> Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
>>> right thing so this seems unnecessary & buggy here.
>>
>> I think he is asking because TREE_STATIC (decl) || DECL_EXTERNAL
>> (decl) might be an issue for STRING_CSTs.
>
> TREE_STATIC is true for STRING_CSTs and DECL_EXTERNAL false, that looks ok.

The values for STRING_CST make sense, but it is not documented in
tree.h for use with STRING_CST. Maybe do this:

 if (((TREE_CODE (decl) == VAR_DECL&& (TREE_STATIC (decl) ||
DECL_EXTERNAL (decl))
       ||TREE_CODE (decl) == STRING_CST)
      && ix86_in_large_data_p (decl))

which can be simplified to:

 if ((TREE_CODE (decl) == VAR_DECL && is_global_var (decl) ||TREE_CODE
(decl) == STRING_CST)
  && ix86_in_large_data_p (decl))
     ...

David
>
> Thanks
> Sri
>
>>
>> Thanks,
>> Andrew
>>
>>
>>>
>>> Thanks
>>> Sri
>>>
>>>>
>>>> David
>>>>
>>>> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>>> Hi,
>>>>>
>>>>>    This patch is under review for trunk GCC :
>>>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>>>>
>>>>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>>>>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>>>>> boundary.
>>>>>
>>>>> Thanks
>>>>> Sri

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 20:10         ` Xinliang David Li
@ 2014-10-20 20:46           ` Sriraman Tallam
  2014-10-20 20:56             ` Xinliang David Li
  0 siblings, 1 reply; 10+ messages in thread
From: Sriraman Tallam @ 2014-10-20 20:46 UTC (permalink / raw)
  To: Xinliang David Li
  Cc: Andrew Pinski, GCC Patches, Jan Hubicka, Cary Coutant, Paul Pluzhnikov

[-- Attachment #1: Type: text/plain, Size: 1980 bytes --]

On Mon, Oct 20, 2014 at 12:59 PM, Xinliang David Li <davidxl@google.com> wrote:
> On Mon, Oct 20, 2014 at 11:59 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>> On Mon, Oct 20, 2014 at 10:51 AM, Andrew Pinski <pinskia@gmail.com> wrote:
>>> On Mon, Oct 20, 2014 at 10:46 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>> On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
>>>>> Why removing the tree_code check?
>>>>
>>>> The actual problem happens because STRING_CSTs (end up in .lrodata)
>>>> are not set a far address as they dont match the VAR_DECL check here.
>>>> Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
>>>> right thing so this seems unnecessary & buggy here.
>>>
>>> I think he is asking because TREE_STATIC (decl) || DECL_EXTERNAL
>>> (decl) might be an issue for STRING_CSTs.
>>
>> TREE_STATIC is true for STRING_CSTs and DECL_EXTERNAL false, that looks ok.
>
> The values for STRING_CST make sense, but it is not documented in
> tree.h for use with STRING_CST. Maybe do this:
>
>  if (((TREE_CODE (decl) == VAR_DECL&& (TREE_STATIC (decl) ||
> DECL_EXTERNAL (decl))
>        ||TREE_CODE (decl) == STRING_CST)
>       && ix86_in_large_data_p (decl))
>
> which can be simplified to:
>
>  if ((TREE_CODE (decl) == VAR_DECL && is_global_var (decl) ||TREE_CODE
> (decl) == STRING_CST)
>   && ix86_in_large_data_p (decl))

Patch updated.

Thanks
Sri

>      ...
>
> David
>>
>> Thanks
>> Sri
>>
>>>
>>> Thanks,
>>> Andrew
>>>
>>>
>>>>
>>>> Thanks
>>>> Sri
>>>>
>>>>>
>>>>> David
>>>>>
>>>>> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>>>> Hi,
>>>>>>
>>>>>>    This patch is under review for trunk GCC :
>>>>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>>>>>
>>>>>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>>>>>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>>>>>> boundary.
>>>>>>
>>>>>> Thanks
>>>>>> Sri

[-- Attachment #2: pr63538.txt --]
[-- Type: text/plain, Size: 1232 bytes --]

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 216287)
+++ config/i386/i386.c	(working copy)
@@ -41331,8 +41331,8 @@ ix86_encode_section_info (tree decl, rtx rtl, int
 {
   default_encode_section_info (decl, rtl, first);
 
-  if (TREE_CODE (decl) == VAR_DECL
-      && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
+  if (((TREE_CODE (decl) == VAR_DECL && is_global_var (decl))
+       || TREE_CODE(decl) == STRING_CST)
       && ix86_in_large_data_p (decl))
     SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_FAR_ADDR;
 }
Index: testsuite/gcc.dg/pr63538.c
===================================================================
--- testsuite/gcc.dg/pr63538.c	(revision 0)
+++ testsuite/gcc.dg/pr63538.c	(revision 0)
@@ -0,0 +1,14 @@
+/* PR63538 is about not using 64-bit addresses for .lrodata accesses when it
+   involves STRING_CSTs.  */
+/* { dg-do compile { target x86_64-*-* } } */
+/* { dg-options "-O2 -mcmodel=medium -mlarge-data-threshold=0" { target x86_64-*-* } } */
+
+#include <stdio.h>
+
+const char *str = "Hello World";
+
+int main() {
+ printf("str = %p %s\n",str, str);
+ return 0;
+}
+/* { dg-final { scan-assembler-not "movl" } } */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Google/gcc-4_9][PATCH][target/x86_64] PR 63538
  2014-10-20 20:46           ` Sriraman Tallam
@ 2014-10-20 20:56             ` Xinliang David Li
  0 siblings, 0 replies; 10+ messages in thread
From: Xinliang David Li @ 2014-10-20 20:56 UTC (permalink / raw)
  To: Sriraman Tallam
  Cc: Andrew Pinski, GCC Patches, Jan Hubicka, Cary Coutant, Paul Pluzhnikov

ok (for google branch).

David

On Mon, Oct 20, 2014 at 1:44 PM, Sriraman Tallam <tmsriram@google.com> wrote:
> On Mon, Oct 20, 2014 at 12:59 PM, Xinliang David Li <davidxl@google.com> wrote:
>> On Mon, Oct 20, 2014 at 11:59 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>> On Mon, Oct 20, 2014 at 10:51 AM, Andrew Pinski <pinskia@gmail.com> wrote:
>>>> On Mon, Oct 20, 2014 at 10:46 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>>> On Mon, Oct 20, 2014 at 10:42 AM, Xinliang David Li <davidxl@google.com> wrote:
>>>>>> Why removing the tree_code check?
>>>>>
>>>>> The actual problem happens because STRING_CSTs (end up in .lrodata)
>>>>> are not set a far address as they dont match the VAR_DECL check here.
>>>>> Futher,  "ix86_in_large_data_p" call has the TREE_CODE check to do the
>>>>> right thing so this seems unnecessary & buggy here.
>>>>
>>>> I think he is asking because TREE_STATIC (decl) || DECL_EXTERNAL
>>>> (decl) might be an issue for STRING_CSTs.
>>>
>>> TREE_STATIC is true for STRING_CSTs and DECL_EXTERNAL false, that looks ok.
>>
>> The values for STRING_CST make sense, but it is not documented in
>> tree.h for use with STRING_CST. Maybe do this:
>>
>>  if (((TREE_CODE (decl) == VAR_DECL&& (TREE_STATIC (decl) ||
>> DECL_EXTERNAL (decl))
>>        ||TREE_CODE (decl) == STRING_CST)
>>       && ix86_in_large_data_p (decl))
>>
>> which can be simplified to:
>>
>>  if ((TREE_CODE (decl) == VAR_DECL && is_global_var (decl) ||TREE_CODE
>> (decl) == STRING_CST)
>>   && ix86_in_large_data_p (decl))
>
> Patch updated.
>
> Thanks
> Sri
>
>>      ...
>>
>> David
>>>
>>> Thanks
>>> Sri
>>>
>>>>
>>>> Thanks,
>>>> Andrew
>>>>
>>>>
>>>>>
>>>>> Thanks
>>>>> Sri
>>>>>
>>>>>>
>>>>>> David
>>>>>>
>>>>>> On Mon, Oct 20, 2014 at 10:35 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>>    This patch is under review for trunk GCC :
>>>>>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01638.html.
>>>>>>>
>>>>>>>     In the mean time, is this ok for google/gcc-4_9 branch?  Without
>>>>>>> this, -mcmodel=medium is unusable if .lrodata goes beyond the 2G
>>>>>>> boundary.
>>>>>>>
>>>>>>> Thanks
>>>>>>> Sri

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-20 20:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-20 17:42 [Google/gcc-4_9][PATCH][target/x86_64] PR 63538 Sriraman Tallam
2014-10-20 17:46 ` Xinliang David Li
2014-10-20 17:51   ` Sriraman Tallam
2014-10-20 17:58     ` Andrew Pinski
2014-10-20 19:09       ` Sriraman Tallam
2014-10-20 20:10         ` Xinliang David Li
2014-10-20 20:46           ` Sriraman Tallam
2014-10-20 20:56             ` Xinliang David Li
2014-10-20 18:05     ` Xinliang David Li
2014-10-20 18:59       ` Sriraman Tallam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).