aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2012-05-30 22:54:20 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2012-05-30 22:54:20 +0000
commitfda33f152e2189356b71df582a2ce961e4f951e2 (patch)
treeb307e7994e951b85c79573cb1baee1d288f830c0 /gcc
parent66edf32a6fd51d8ad5815e5d995421f037dadadc (diff)
downloadgcc-fda33f152e2189356b71df582a2ce961e4f951e2.zip
gcc-fda33f152e2189356b71df582a2ce961e4f951e2.tar.gz
gcc-fda33f152e2189356b71df582a2ce961e4f951e2.tar.bz2
re PR target/52999 (ICE, segmentation fault in c_tree_printer)
2012-05-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> PR target/52999 * config/pa/pa.c (TARGET_SECTION_TYPE_FLAGS): Define. (pa_section_type_flags): New. (pa_legitimate_constant_p): Revert previous change. From-SVN: r188031
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/pa/pa.c25
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 83ae003..57abebc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/52999
+ * config/pa/pa.c (TARGET_SECTION_TYPE_FLAGS): Define.
+ (pa_section_type_flags): New.
+ (pa_legitimate_constant_p): Revert previous change.
+
2012-05-30 Steven Bosscher <steven@gcc.gnu.org>
* ira.c (allocate_initial_values): Make static.
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 95f2262..02c00ba 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -187,6 +187,7 @@ static enum machine_mode pa_c_mode_for_suffix (char);
static section *pa_function_section (tree, enum node_frequency, bool, bool);
static bool pa_cannot_force_const_mem (enum machine_mode, rtx);
static bool pa_legitimate_constant_p (enum machine_mode, rtx);
+static unsigned int pa_section_type_flags (tree, const char *, int);
/* The following extra sections are only used for SOM. */
static GTY(()) section *som_readonly_data_section;
@@ -382,6 +383,8 @@ static size_t n_deferred_plabels = 0;
#undef TARGET_LEGITIMATE_CONSTANT_P
#define TARGET_LEGITIMATE_CONSTANT_P pa_legitimate_constant_p
+#undef TARGET_SECTION_TYPE_FLAGS
+#define TARGET_SECTION_TYPE_FLAGS pa_section_type_flags
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -10339,7 +10342,29 @@ pa_legitimate_constant_p (enum machine_mode mode, rtx x)
&& !pa_cint_ok_for_move (INTVAL (x)))
return false;
+ if (function_label_operand (x, mode))
+ return false;
+
return true;
}
+/* Implement TARGET_SECTION_TYPE_FLAGS. */
+
+static unsigned int
+pa_section_type_flags (tree decl, const char *name, int reloc)
+{
+ unsigned int flags;
+
+ flags = default_section_type_flags (decl, name, reloc);
+
+ /* Function labels are placed in the constant pool. This can
+ cause a section conflict if decls are put in ".data.rel.ro"
+ or ".data.rel.ro.local" using the __attribute__ construct. */
+ if (strcmp (name, ".data.rel.ro") == 0
+ || strcmp (name, ".data.rel.ro.local") == 0)
+ flags |= SECTION_WRITE | SECTION_RELRO;
+
+ return flags;
+}
+
#include "gt-pa.h"