Commit 010403d1 by Richard Biener Committed by Richard Biener

re PR lto/50494 (gcc.dg/vect/vect-reduc-2char.c fails spuriously on ppc with -flto)

2013-03-06  Richard Biener  <rguenther@suse.de>

	PR middle-end/50494
	* tree-vect-data-refs.c (vect_can_force_dr_alignment_p):
	Do not adjust alignment of DECL_IN_CONSTANT_POOL decls.

	Revert
	2013-02-13  Richard Biener  <rguenther@suse.de>

	PR lto/50494
	* varasm.c (output_constant_def_1): Get the decl representing
	the constant as argument.
	(output_constant_def): Wrap output_constant_def_1.
	(make_decl_rtl): Use output_constant_def_1 with the decl
	representing the constant.
	(build_constant_desc): Optionally re-use a decl already
	representing the constant.
	(tree_output_constant_def): Adjust.

From-SVN: r196487
parent 34d3a672
2013-03-06 Richard Biener <rguenther@suse.de>
PR middle-end/50494
* tree-vect-data-refs.c (vect_can_force_dr_alignment_p):
Do not adjust alignment of DECL_IN_CONSTANT_POOL decls.
Revert
2013-02-13 Richard Biener <rguenther@suse.de>
PR lto/50494
* varasm.c (output_constant_def_1): Get the decl representing
the constant as argument.
(output_constant_def): Wrap output_constant_def_1.
(make_decl_rtl): Use output_constant_def_1 with the decl
representing the constant.
(build_constant_desc): Optionally re-use a decl already
representing the constant.
(tree_output_constant_def): Adjust.
2013-03-06 Joey Ye <joey.ye@arm.com> 2013-03-06 Joey Ye <joey.ye@arm.com>
PR lto/50293 PR lto/50293
......
...@@ -4829,9 +4829,12 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment) ...@@ -4829,9 +4829,12 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment)
/* We cannot change alignment of common or external symbols as another /* We cannot change alignment of common or external symbols as another
translation unit may contain a definition with lower alignment. translation unit may contain a definition with lower alignment.
The rules of common symbol linking mean that the definition The rules of common symbol linking mean that the definition
will override the common symbol. */ will override the common symbol. The same is true for constant
pool entries which may be shared and are not properly merged
by LTO. */
if (DECL_EXTERNAL (decl) if (DECL_EXTERNAL (decl)
|| DECL_COMMON (decl)) || DECL_COMMON (decl)
|| DECL_IN_CONSTANT_POOL (decl))
return false; return false;
if (TREE_ASM_WRITTEN (decl)) if (TREE_ASM_WRITTEN (decl))
......
...@@ -126,7 +126,6 @@ static void asm_output_aligned_bss (FILE *, tree, const char *, ...@@ -126,7 +126,6 @@ static void asm_output_aligned_bss (FILE *, tree, const char *,
#endif /* BSS_SECTION_ASM_OP */ #endif /* BSS_SECTION_ASM_OP */
static void mark_weak (tree); static void mark_weak (tree);
static void output_constant_pool (const char *, tree); static void output_constant_pool (const char *, tree);
static rtx output_constant_def_1 (tree, tree, int);
/* Well-known sections, each one associated with some sort of *_ASM_OP. */ /* Well-known sections, each one associated with some sort of *_ASM_OP. */
section *text_section; section *text_section;
...@@ -1187,8 +1186,7 @@ make_decl_rtl (tree decl) ...@@ -1187,8 +1186,7 @@ make_decl_rtl (tree decl)
pre-computed RTL or recompute it in LTO mode. */ pre-computed RTL or recompute it in LTO mode. */
if (TREE_CODE (decl) == VAR_DECL && DECL_IN_CONSTANT_POOL (decl)) if (TREE_CODE (decl) == VAR_DECL && DECL_IN_CONSTANT_POOL (decl))
{ {
SET_DECL_RTL (decl, output_constant_def_1 (DECL_INITIAL (decl), SET_DECL_RTL (decl, output_constant_def (DECL_INITIAL (decl), 1));
decl, 1));
return; return;
} }
...@@ -3075,16 +3073,16 @@ get_constant_size (tree exp) ...@@ -3075,16 +3073,16 @@ get_constant_size (tree exp)
Make a constant descriptor to enter EXP in the hash table. Make a constant descriptor to enter EXP in the hash table.
Assign the label number and construct RTL to refer to the Assign the label number and construct RTL to refer to the
constant's location in memory. constant's location in memory.
If DECL is non-NULL use it as VAR_DECL associated with the constant.
Caller is responsible for updating the hash table. */ Caller is responsible for updating the hash table. */
static struct constant_descriptor_tree * static struct constant_descriptor_tree *
build_constant_desc (tree exp, tree decl) build_constant_desc (tree exp)
{ {
struct constant_descriptor_tree *desc; struct constant_descriptor_tree *desc;
rtx symbol, rtl; rtx symbol, rtl;
char label[256]; char label[256];
int labelno; int labelno;
tree decl;
desc = ggc_alloc_constant_descriptor_tree (); desc = ggc_alloc_constant_descriptor_tree ();
desc->value = copy_constant (exp); desc->value = copy_constant (exp);
...@@ -3098,32 +3096,28 @@ build_constant_desc (tree exp, tree decl) ...@@ -3098,32 +3096,28 @@ build_constant_desc (tree exp, tree decl)
ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno); ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno);
/* Construct the VAR_DECL associated with the constant. */ /* Construct the VAR_DECL associated with the constant. */
if (decl == NULL_TREE) decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier (label),
{ TREE_TYPE (exp));
decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier (label), DECL_ARTIFICIAL (decl) = 1;
TREE_TYPE (exp)); DECL_IGNORED_P (decl) = 1;
DECL_ARTIFICIAL (decl) = 1; TREE_READONLY (decl) = 1;
DECL_IGNORED_P (decl) = 1; TREE_STATIC (decl) = 1;
TREE_READONLY (decl) = 1; TREE_ADDRESSABLE (decl) = 1;
TREE_STATIC (decl) = 1; /* We don't set the RTL yet as this would cause varpool to assume that the
TREE_ADDRESSABLE (decl) = 1; variable is referenced. Moreover, it would just be dropped in LTO mode.
/* We don't set the RTL yet as this would cause varpool to assume that Instead we set the flag that will be recognized in make_decl_rtl. */
the variable is referenced. Moreover, it would just be dropped in DECL_IN_CONSTANT_POOL (decl) = 1;
LTO mode. Instead we set the flag that will be recognized in DECL_INITIAL (decl) = desc->value;
make_decl_rtl. */ /* ??? CONSTANT_ALIGNMENT hasn't been updated for vector types on most
DECL_IN_CONSTANT_POOL (decl) = 1; architectures so use DATA_ALIGNMENT as well, except for strings. */
DECL_INITIAL (decl) = desc->value; if (TREE_CODE (exp) == STRING_CST)
/* ??? CONSTANT_ALIGNMENT hasn't been updated for vector types on most {
architectures so use DATA_ALIGNMENT as well, except for strings. */
if (TREE_CODE (exp) == STRING_CST)
{
#ifdef CONSTANT_ALIGNMENT #ifdef CONSTANT_ALIGNMENT
DECL_ALIGN (decl) = CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl)); DECL_ALIGN (decl) = CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl));
#endif #endif
}
else
align_variable (decl, 0);
} }
else
align_variable (decl, 0);
/* Now construct the SYMBOL_REF and the MEM. */ /* Now construct the SYMBOL_REF and the MEM. */
if (use_object_blocks_p ()) if (use_object_blocks_p ())
...@@ -3160,7 +3154,7 @@ build_constant_desc (tree exp, tree decl) ...@@ -3160,7 +3154,7 @@ build_constant_desc (tree exp, tree decl)
} }
/* Return an rtx representing a reference to constant data in memory /* Return an rtx representing a reference to constant data in memory
for the constant expression EXP with the associated DECL. for the constant expression EXP.
If assembler code for such a constant has already been output, If assembler code for such a constant has already been output,
return an rtx to refer to it. return an rtx to refer to it.
...@@ -3172,8 +3166,8 @@ build_constant_desc (tree exp, tree decl) ...@@ -3172,8 +3166,8 @@ build_constant_desc (tree exp, tree decl)
`const_desc_table' records which constants already have label strings. */ `const_desc_table' records which constants already have label strings. */
static rtx rtx
output_constant_def_1 (tree exp, tree decl, int defer) output_constant_def (tree exp, int defer)
{ {
struct constant_descriptor_tree *desc; struct constant_descriptor_tree *desc;
struct constant_descriptor_tree key; struct constant_descriptor_tree key;
...@@ -3188,7 +3182,7 @@ output_constant_def_1 (tree exp, tree decl, int defer) ...@@ -3188,7 +3182,7 @@ output_constant_def_1 (tree exp, tree decl, int defer)
desc = (struct constant_descriptor_tree *) *loc; desc = (struct constant_descriptor_tree *) *loc;
if (desc == 0) if (desc == 0)
{ {
desc = build_constant_desc (exp, decl); desc = build_constant_desc (exp);
desc->hash = key.hash; desc->hash = key.hash;
*loc = desc; *loc = desc;
} }
...@@ -3197,15 +3191,6 @@ output_constant_def_1 (tree exp, tree decl, int defer) ...@@ -3197,15 +3191,6 @@ output_constant_def_1 (tree exp, tree decl, int defer)
return desc->rtl; return desc->rtl;
} }
/* Like output_constant_def but create a new decl representing the
constant if necessary. */
rtx
output_constant_def (tree exp, int defer)
{
return output_constant_def_1 (exp, NULL_TREE, defer);
}
/* Subroutine of output_constant_def: Decide whether or not we need to /* Subroutine of output_constant_def: Decide whether or not we need to
output the constant DESC now, and if so, do it. */ output the constant DESC now, and if so, do it. */
static void static void
...@@ -3342,7 +3327,7 @@ tree_output_constant_def (tree exp) ...@@ -3342,7 +3327,7 @@ tree_output_constant_def (tree exp)
desc = (struct constant_descriptor_tree *) *loc; desc = (struct constant_descriptor_tree *) *loc;
if (desc == 0) if (desc == 0)
{ {
desc = build_constant_desc (exp, NULL_TREE); desc = build_constant_desc (exp);
desc->hash = key.hash; desc->hash = key.hash;
*loc = desc; *loc = desc;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment