===================================================================
@@ -41387,8 +41387,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;
}
===================================================================
@@ -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" } } */