aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2024-01-18 22:46:19 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2024-01-18 22:46:19 +0000
commit0c7c65c4c359f8bfa1ebcb7b1c409af314064da2 (patch)
tree00f3319449036d8b76ad4df5d2e691492935ae3c
parentb6c4fcda7fea2c6e14f539780f976bdc1d2591fb (diff)
downloadgcc-0c7c65c4c359f8bfa1ebcb7b1c409af314064da2.zip
gcc-0c7c65c4c359f8bfa1ebcb7b1c409af314064da2.tar.gz
gcc-0c7c65c4c359f8bfa1ebcb7b1c409af314064da2.tar.bz2
hppa: Always enable PIE on 64-bit target
2024-01-18 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: PR tree-optimization/69807 * config/pa/pa.cc (pa_option_override): Set flag_pie on TARGET_64BIT. gcc/testsuite/ChangeLog: * gcc.dg/pic-2.c: Skip on hppa*64*-*-*.
-rw-r--r--gcc/config/pa/pa.cc4
-rw-r--r--gcc/testsuite/gcc.dg/pic-2.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 48a370c..c58b0a0 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -557,6 +557,10 @@ pa_option_override (void)
if (flag_pic == 1 || TARGET_64BIT)
flag_pic = 2;
+ /* 64-bit target is always PIE. */
+ if (TARGET_64BIT)
+ flag_pie = 2;
+
/* Disable -freorder-blocks-and-partition as we don't support hot and
cold partitioning. */
if (flag_reorder_blocks_and_partition)
diff --git a/gcc/testsuite/gcc.dg/pic-2.c b/gcc/testsuite/gcc.dg/pic-2.c
index 2426053..0746846 100644
--- a/gcc/testsuite/gcc.dg/pic-2.c
+++ b/gcc/testsuite/gcc.dg/pic-2.c
@@ -3,6 +3,7 @@
/* { dg-options "-fPIC" } */
/* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */
/* { dg-skip-if "__PIE__ is always defined for GCN" { amdgcn*-*-* } } */
+/* { dg-skip-if "__PIE__ is always defined for hppa64" { hppa*64*-*-* } } */
#if defined(__CYGWIN__) || defined(__WIN32__)
# if __PIC__ != 1