]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/52999 (ICE, segmentation fault in c_tree_printer)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sun, 3 Jun 2012 12:41:02 +0000 (12:41 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 3 Jun 2012 12:41:02 +0000 (12:41 +0000)
PR target/52999
* config/pa/pa.c (TARGET_SECTION_TYPE_FLAGS): Define.
(pa_section_type_flags): New.
* config/pa/pa.h (LEGITIMATE_CONSTANT_P): Revert previous change.

From-SVN: r188150

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa.h

index 24a9a04c42cfbe9e1b02856e119b816095714877..0fd9ac9ecf1019ca385cbefc387f27af710b3fe3 100644 (file)
@@ -1,3 +1,10 @@
+2012-06-03  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.
+       * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Revert previous change.
+
 2012-05-31  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/53541
index 5e5a0f05b79725f08d5623c1443bb647620778a6..6f67ca8ea3454680d3e1ce825c00fdc149dad877 100644 (file)
@@ -185,6 +185,7 @@ static bool pa_can_eliminate (const int, const int);
 static void pa_conditional_register_usage (void);
 static enum machine_mode pa_c_mode_for_suffix (char);
 static section *pa_function_section (tree, enum node_frequency, bool, bool);
+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;
@@ -400,6 +401,9 @@ static const struct default_options pa_option_optimization_table[] =
 #undef TARGET_ASM_FUNCTION_SECTION
 #define TARGET_ASM_FUNCTION_SECTION pa_function_section
 
+#undef TARGET_SECTION_TYPE_FLAGS
+#define TARGET_SECTION_TYPE_FLAGS pa_section_type_flags
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Parse the -mfixed-range= option string.  */
@@ -10431,4 +10435,23 @@ pa_function_section (tree decl, enum node_frequency freq,
   return default_function_section (decl, freq, startup, exit);
 }
 
+/* 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"
index 6c587941b5a8d11329bed93e9a693ed1d71849ac..012186854de53877ab0814ff0a959032d0bedec1 100644 (file)
@@ -859,7 +859,8 @@ extern int may_call_alloca;
        || reload_in_progress                                   \
        || reload_completed                                     \
        || LEGITIMATE_64BIT_CONST_INT_P (INTVAL (X))            \
-       || cint_ok_for_move (INTVAL (X))))
+       || cint_ok_for_move (INTVAL (X)))                       \
+   && !function_label_operand (X, VOIDmode))
 
 /* Target flags set on a symbol_ref.  */