This is an automated email from the git hooks/post-receive script.
unknown user pushed a change to branch aoliva/pr64164
in repository gcc.
discards dec701a try special handlling of byref parms
new 1013892 try special handling of byref parms
new 9357ff1 further adjustments to handling of byref parms
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (dec701a)
\
N -- N -- N refs/heads/aoliva/pr64164 (9357ff1)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omits" are not gone; other references still
refer to them. Any revisions marked "discards" are gone forever.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
gcc/cfgexpand.c | 23 ++++++++++++++++-------
gcc/function.c | 17 ++++++++++++-----
2 files changed, 28 insertions(+), 12 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a change to branch trunk
in repository gcc.
from 68a98a7 Fix PR 66521
new 3d5db02 2015-08-01 Michael Collison <michael.collison(a)linaro.org [...]
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
gcc/ChangeLog | 6 ++++++
gcc/config/arm/arm.md | 38 +++++++++++++++++++++++++++++++++++
gcc/testsuite/ChangeLog | 5 +++++
gcc/testsuite/gcc.target/arm/mincmp.c | 20 ++++++++++++++++++
4 files changed, 69 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/arm/mincmp.c
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a commit to branch aoliva/pr64164
in repository gcc.
commit dec701a4cad77d8a1c06d7dad0e568b97a00abc1
Author: Alexandre Oliva <aoliva(a)redhat.com>
Date: Sat Aug 1 22:04:17 2015 -0300
try special handlling of byref parms
for gcc/ChangeLog
PR middle-end/67034
* cfgexpand.c (parm_maybe_byref_p): New.
(expand_one_ssa_partition): Call it. Expand maybe-byref parms
with a placeholder for the mem addr.
* function.c (assign_parm_setup_block): Replace the
placeholder with the address of the newly-allocated block.
(assign_parm_setup_reg): Replace the placeholder with a
newly-created pseudo. Arrange for the pseudo to be
initialized from the incoming passed pointer. Don't copy the
BLKmode data, just check that it was a maybe_byref parm.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* tree-ssa-coalesce.c: Include cfgexpand.h.
(gimple_can_coalesce_p): Do not coalesce maybe-byref parms
with SSA_NAMEs of other variables, or anonymous SSA_NAMEs.
---
gcc/cfgexpand.c | 33 ++++++++++++++++++++++-
gcc/cfgexpand.h | 1 +
gcc/function.c | 70 +++++++++++++++++++++++++++----------------------
gcc/tree-ssa-coalesce.c | 12 ++++++---
4 files changed, 80 insertions(+), 36 deletions(-)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 9577ad6d..5b89359 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -172,6 +172,26 @@ leader_merge (tree cur, tree next)
return cur;
}
+/* Return true if VAR is a PARM_DECL or a RESULT_DECL of type BLKmode.
+ Such parameters are likely passed as a pointer to the value, rather
+ than as a value, and so we must not coalesce them, nor allocate
+ stack space for them before determining the calling conventions for
+ them. For their SSA_NAMEs, expand_one_ssa_partition emits RTL as
+ MEMs with pc_rtx as the address, and then it replaces the pc_rtx
+ with NULL so as to make sure the MEM is not used before it is
+ adjusted in assign_parm_setup_reg. */
+
+bool
+parm_maybe_byref_p (tree var)
+{
+ if (!var || VAR_P (var))
+ return false;
+
+ gcc_assert (TREE_CODE (var) == PARM_DECL
+ || TREE_CODE (var) == RESULT_DECL);
+
+ return TYPE_MODE (TREE_TYPE (var)) == BLKmode;
+}
/* Return the RTL for the default SSA def of a PARM or RESULT, if
there is one. */
@@ -1315,7 +1335,18 @@ expand_one_ssa_partition (tree var)
if (!use_register_for_decl (var))
{
- if (defer_stack_allocation (var, true))
+ if (parm_maybe_byref_p (SSA_NAME_VAR (var)))
+ {
+ expand_one_stack_var_at (var, pc_rtx, 0, 0);
+ rtx x = SA.partition_to_pseudo[part];
+ gcc_assert (GET_CODE (x) == MEM);
+ gcc_assert (GET_MODE (x) == BLKmode);
+ gcc_assert (XEXP (x, 0) == pc_rtx);
+ /* Reset the address, so that any attempt to use it will
+ ICE. It will be adjusted in assign_parm_setup_reg. */
+ XEXP (x, 0) = NULL_RTX;
+ }
+ else if (defer_stack_allocation (var, true))
add_stack_var (var);
else
expand_one_stack_var_1 (var);
diff --git a/gcc/cfgexpand.h b/gcc/cfgexpand.h
index 602579d..987cf356 100644
--- a/gcc/cfgexpand.h
+++ b/gcc/cfgexpand.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
extern tree gimple_assign_rhs_to_tree (gimple);
extern HOST_WIDE_INT estimated_stack_frame_size (struct cgraph_node *);
+extern bool parm_maybe_byref_p (tree);
extern rtx get_rtl_for_parm_ssa_default_def (tree var);
diff --git a/gcc/function.c b/gcc/function.c
index 390b81e..abbffc5 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2955,16 +2955,27 @@ assign_parm_setup_block (struct assign_parm_data_all *all,
if (stack_parm == 0)
{
DECL_ALIGN (parm) = MAX (DECL_ALIGN (parm), BITS_PER_WORD);
- stack_parm = rtl_for_parm (all, parm);
- if (stack_parm)
- stack_parm = copy_rtx (stack_parm);
+ rtx from_expand = rtl_for_parm (all, parm);
+ if (from_expand && (!parm_maybe_byref_p (parm)
+ || XEXP (from_expand, 0) != NULL_RTX))
+ stack_parm = copy_rtx (from_expand);
else
{
stack_parm = assign_stack_local (BLKmode, size_stored,
DECL_ALIGN (parm));
if (GET_MODE_SIZE (GET_MODE (entry_parm)) == size)
PUT_MODE (stack_parm, GET_MODE (entry_parm));
- set_mem_attributes (stack_parm, parm, 1);
+ if (from_expand)
+ {
+ gcc_assert (GET_CODE (stack_parm) == MEM);
+ gcc_assert (GET_CODE (from_expand) == MEM);
+ gcc_assert (XEXP (from_expand, 0) == NULL_RTX);
+ XEXP (from_expand, 0) = XEXP (stack_parm, 0);
+ PUT_MODE (from_expand, GET_MODE (stack_parm));
+ stack_parm = copy_rtx (from_expand);
+ }
+ else
+ set_mem_attributes (stack_parm, parm, 1);
}
}
@@ -3103,24 +3114,34 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
= promote_function_mode (data->nominal_type, data->nominal_mode, &unsignedp,
TREE_TYPE (current_function_decl), 2);
- rtx from_expand = rtl_for_parm (all, parm);
+ rtx from_expand = parmreg = rtl_for_parm (all, parm);
- if (from_expand)
+ if (from_expand && !data->passed_pointer)
{
- parmreg = from_expand;
- if (!data->passed_pointer && GET_MODE (parmreg) != promoted_nominal_mode)
+ if (GET_MODE (parmreg) != promoted_nominal_mode)
parmreg = gen_lowpart (promoted_nominal_mode, parmreg);
}
- else
+ else if (!from_expand || parm_maybe_byref_p (parm))
{
parmreg = gen_reg_rtx (promoted_nominal_mode);
if (!DECL_ARTIFICIAL (parm))
mark_user_reg (parmreg);
+
+ if (from_expand)
+ {
+ gcc_assert (data->passed_pointer);
+ gcc_assert (GET_CODE (from_expand) == MEM
+ && GET_MODE (from_expand) == BLKmode
+ && XEXP (from_expand, 0) == NULL_RTX);
+ XEXP (from_expand, 0) = parmreg;
+ }
}
/* If this was an item that we received a pointer to,
set DECL_RTL appropriately. */
- if (!from_expand && data->passed_pointer)
+ if (from_expand)
+ SET_DECL_RTL (parm, from_expand);
+ else if (data->passed_pointer)
{
rtx x = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data->passed_type)), parmreg);
set_mem_attributes (x, parm, 1);
@@ -3141,8 +3162,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
need_conversion = (data->nominal_mode != data->passed_mode
|| promoted_nominal_mode != data->promoted_mode);
- gcc_assert (!(need_conversion && data->passed_pointer));
- moved = from_expand && data->passed_pointer;
+ moved = false;
if (need_conversion
&& GET_MODE_CLASS (data->nominal_mode) == MODE_INT
@@ -3281,15 +3301,12 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
if (data->passed_pointer
&& (from_expand || TYPE_MODE (TREE_TYPE (parm)) != BLKmode))
{
- rtx src = DECL_RTL (parm);
-
/* We can't use nominal_mode, because it will have been set to
Pmode above. We must use the actual mode of the parm. */
if (from_expand)
{
+ parmreg = from_expand;
gcc_assert (GET_MODE (parmreg) == TYPE_MODE (TREE_TYPE (parm)));
- src = gen_rtx_MEM (GET_MODE (parmreg), validated_mem);
- set_mem_attributes (src, parm, 1);
}
else if (use_register_for_decl (parm))
{
@@ -3308,14 +3325,14 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
set_mem_attributes (parmreg, parm, 1);
}
- if (GET_MODE (parmreg) != GET_MODE (src))
+ if (GET_MODE (parmreg) != GET_MODE (DECL_RTL (parm)))
{
- rtx tempreg = gen_reg_rtx (GET_MODE (src));
+ rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
int unsigned_p = TYPE_UNSIGNED (TREE_TYPE (parm));
push_to_sequence2 (all->first_conversion_insn,
all->last_conversion_insn);
- emit_move_insn (tempreg, src);
+ emit_move_insn (tempreg, DECL_RTL (parm));
tempreg = convert_to_mode (GET_MODE (parmreg), tempreg, unsigned_p);
emit_move_insn (parmreg, tempreg);
all->first_conversion_insn = get_insns ();
@@ -3325,20 +3342,9 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
did_conversion = true;
}
else if (GET_MODE (parmreg) == BLKmode)
- {
- push_to_sequence2 (all->first_conversion_insn,
- all->last_conversion_insn);
- gcc_assert (TREE_CODE (data->passed_type) == POINTER_TYPE);
- gcc_assert (TREE_TYPE (data->passed_type) == TREE_TYPE (parm));
- emit_block_move (parmreg, src,
- GEN_INT (int_size_in_bytes (TREE_TYPE (parm))),
- BLOCK_OP_NORMAL);;
- all->first_conversion_insn = get_insns ();
- all->last_conversion_insn = get_last_insn ();
- end_sequence ();
- }
+ gcc_assert (parm_maybe_byref_p (parm));
else
- emit_move_insn (parmreg, src);
+ emit_move_insn (parmreg, DECL_RTL (parm));
SET_DECL_RTL (parm, parmreg);
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index a622728..08ce72c 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-iterator.h"
#include "tree-ssa-live.h"
#include "tree-ssa-coalesce.h"
+#include "cfgexpand.h"
#include "explow.h"
#include "diagnostic-core.h"
@@ -1379,10 +1380,15 @@ gimple_can_coalesce_p (tree name1, tree name2)
/* Check that the promoted modes are the same. We don't want to
coalesce if the promoted modes would be different. Only
PARM_DECLs and RESULT_DECLs have different promotion rules,
- so skip the test if we both are variables or anonymous
- SSA_NAMEs. */
+ so skip the test if both are variables, or both are anonymous
+ SSA_NAMEs. Now, if a parm or result has BLKmode, do not
+ coalesce its SSA versions with those of any other variables,
+ because it may be passed by reference. */
return ((!var1 || VAR_P (var1)) && (!var2 || VAR_P (var2)))
- || promote_ssa_mode (name1, NULL) == promote_ssa_mode (name2, NULL);
+ || (/* The case var1 == var2 is already covered above. */
+ !parm_maybe_byref_p (var1)
+ && !parm_maybe_byref_p (var2)
+ && promote_ssa_mode (name1, NULL) == promote_ssa_mode (name2, NULL));
}
/* If the types are not the same, check for a canonical type match. This
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a change to branch aoliva/pr64164
in repository gcc.
discards 3672f75 try special handlling of byref parms
new dec701a try special handlling of byref parms
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (3672f75)
\
N -- N -- N refs/heads/aoliva/pr64164 (dec701a)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omits" are not gone; other references still
refer to them. Any revisions marked "discards" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
gcc/function.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a commit to branch aoliva/pr64164
in repository gcc.
commit 3672f750fe682bc50bbdb4113ec93f81f8617451
Author: Alexandre Oliva <aoliva(a)redhat.com>
Date: Sat Aug 1 22:04:17 2015 -0300
try special handlling of byref parms
for gcc/ChangeLog
PR middle-end/67034
* cfgexpand.c (parm_maybe_byref_p): New.
(expand_one_ssa_partition): Call it. Expand maybe-byref parms
with a placeholder for the mem addr.
* function.c (assign_parm_setup_reg): Replace the placeholder
with a newly-created pseudo. Arrange for the pseudo to be
initialized from the incoming passed pointer. Don't copy the
BLKmode data, just check that it was a maybe_byref parm.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* tree-ssa-coalesce.c: Include cfgexpand.h.
(gimple_can_coalesce_p): Do not coalesce maybe-byref parms
with SSA_NAMEs of other variables, or anonymous SSA_NAMEs.
---
gcc/cfgexpand.c | 33 +++++++++++++++++++++++++++++++-
gcc/cfgexpand.h | 1 +
gcc/function.c | 51 ++++++++++++++++++++++---------------------------
gcc/tree-ssa-coalesce.c | 12 +++++++++---
4 files changed, 65 insertions(+), 32 deletions(-)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 9577ad6d..5b89359 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -172,6 +172,26 @@ leader_merge (tree cur, tree next)
return cur;
}
+/* Return true if VAR is a PARM_DECL or a RESULT_DECL of type BLKmode.
+ Such parameters are likely passed as a pointer to the value, rather
+ than as a value, and so we must not coalesce them, nor allocate
+ stack space for them before determining the calling conventions for
+ them. For their SSA_NAMEs, expand_one_ssa_partition emits RTL as
+ MEMs with pc_rtx as the address, and then it replaces the pc_rtx
+ with NULL so as to make sure the MEM is not used before it is
+ adjusted in assign_parm_setup_reg. */
+
+bool
+parm_maybe_byref_p (tree var)
+{
+ if (!var || VAR_P (var))
+ return false;
+
+ gcc_assert (TREE_CODE (var) == PARM_DECL
+ || TREE_CODE (var) == RESULT_DECL);
+
+ return TYPE_MODE (TREE_TYPE (var)) == BLKmode;
+}
/* Return the RTL for the default SSA def of a PARM or RESULT, if
there is one. */
@@ -1315,7 +1335,18 @@ expand_one_ssa_partition (tree var)
if (!use_register_for_decl (var))
{
- if (defer_stack_allocation (var, true))
+ if (parm_maybe_byref_p (SSA_NAME_VAR (var)))
+ {
+ expand_one_stack_var_at (var, pc_rtx, 0, 0);
+ rtx x = SA.partition_to_pseudo[part];
+ gcc_assert (GET_CODE (x) == MEM);
+ gcc_assert (GET_MODE (x) == BLKmode);
+ gcc_assert (XEXP (x, 0) == pc_rtx);
+ /* Reset the address, so that any attempt to use it will
+ ICE. It will be adjusted in assign_parm_setup_reg. */
+ XEXP (x, 0) = NULL_RTX;
+ }
+ else if (defer_stack_allocation (var, true))
add_stack_var (var);
else
expand_one_stack_var_1 (var);
diff --git a/gcc/cfgexpand.h b/gcc/cfgexpand.h
index 602579d..987cf356 100644
--- a/gcc/cfgexpand.h
+++ b/gcc/cfgexpand.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
extern tree gimple_assign_rhs_to_tree (gimple);
extern HOST_WIDE_INT estimated_stack_frame_size (struct cgraph_node *);
+extern bool parm_maybe_byref_p (tree);
extern rtx get_rtl_for_parm_ssa_default_def (tree var);
diff --git a/gcc/function.c b/gcc/function.c
index 390b81e..84ab365 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3103,24 +3103,34 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
= promote_function_mode (data->nominal_type, data->nominal_mode, &unsignedp,
TREE_TYPE (current_function_decl), 2);
- rtx from_expand = rtl_for_parm (all, parm);
+ rtx from_expand = parmreg = rtl_for_parm (all, parm);
- if (from_expand)
+ if (from_expand && !data->passed_pointer)
{
- parmreg = from_expand;
- if (!data->passed_pointer && GET_MODE (parmreg) != promoted_nominal_mode)
+ if (GET_MODE (parmreg) != promoted_nominal_mode)
parmreg = gen_lowpart (promoted_nominal_mode, parmreg);
}
- else
+ else if (!from_expand || parm_maybe_byref_p (parm))
{
parmreg = gen_reg_rtx (promoted_nominal_mode);
if (!DECL_ARTIFICIAL (parm))
mark_user_reg (parmreg);
+
+ if (from_expand)
+ {
+ gcc_assert (data->passed_pointer);
+ gcc_assert (GET_CODE (from_expand) == MEM
+ && GET_MODE (from_expand) == BLKmode
+ && XEXP (from_expand, 0) == NULL_RTX);
+ XEXP (from_expand, 0) = parmreg;
+ }
}
/* If this was an item that we received a pointer to,
set DECL_RTL appropriately. */
- if (!from_expand && data->passed_pointer)
+ if (from_expand)
+ SET_DECL_RTL (parm, from_expand);
+ else if (data->passed_pointer)
{
rtx x = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data->passed_type)), parmreg);
set_mem_attributes (x, parm, 1);
@@ -3141,8 +3151,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
need_conversion = (data->nominal_mode != data->passed_mode
|| promoted_nominal_mode != data->promoted_mode);
- gcc_assert (!(need_conversion && data->passed_pointer));
- moved = from_expand && data->passed_pointer;
+ moved = false;
if (need_conversion
&& GET_MODE_CLASS (data->nominal_mode) == MODE_INT
@@ -3281,15 +3290,12 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
if (data->passed_pointer
&& (from_expand || TYPE_MODE (TREE_TYPE (parm)) != BLKmode))
{
- rtx src = DECL_RTL (parm);
-
/* We can't use nominal_mode, because it will have been set to
Pmode above. We must use the actual mode of the parm. */
if (from_expand)
{
+ parmreg = from_expand;
gcc_assert (GET_MODE (parmreg) == TYPE_MODE (TREE_TYPE (parm)));
- src = gen_rtx_MEM (GET_MODE (parmreg), validated_mem);
- set_mem_attributes (src, parm, 1);
}
else if (use_register_for_decl (parm))
{
@@ -3308,14 +3314,14 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
set_mem_attributes (parmreg, parm, 1);
}
- if (GET_MODE (parmreg) != GET_MODE (src))
+ if (GET_MODE (parmreg) != GET_MODE (DECL_RTL (parm)))
{
- rtx tempreg = gen_reg_rtx (GET_MODE (src));
+ rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
int unsigned_p = TYPE_UNSIGNED (TREE_TYPE (parm));
push_to_sequence2 (all->first_conversion_insn,
all->last_conversion_insn);
- emit_move_insn (tempreg, src);
+ emit_move_insn (tempreg, DECL_RTL (parm));
tempreg = convert_to_mode (GET_MODE (parmreg), tempreg, unsigned_p);
emit_move_insn (parmreg, tempreg);
all->first_conversion_insn = get_insns ();
@@ -3325,20 +3331,9 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
did_conversion = true;
}
else if (GET_MODE (parmreg) == BLKmode)
- {
- push_to_sequence2 (all->first_conversion_insn,
- all->last_conversion_insn);
- gcc_assert (TREE_CODE (data->passed_type) == POINTER_TYPE);
- gcc_assert (TREE_TYPE (data->passed_type) == TREE_TYPE (parm));
- emit_block_move (parmreg, src,
- GEN_INT (int_size_in_bytes (TREE_TYPE (parm))),
- BLOCK_OP_NORMAL);;
- all->first_conversion_insn = get_insns ();
- all->last_conversion_insn = get_last_insn ();
- end_sequence ();
- }
+ gcc_assert (parm_maybe_byref_p (parm));
else
- emit_move_insn (parmreg, src);
+ emit_move_insn (parmreg, DECL_RTL (parm));
SET_DECL_RTL (parm, parmreg);
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index a622728..08ce72c 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-iterator.h"
#include "tree-ssa-live.h"
#include "tree-ssa-coalesce.h"
+#include "cfgexpand.h"
#include "explow.h"
#include "diagnostic-core.h"
@@ -1379,10 +1380,15 @@ gimple_can_coalesce_p (tree name1, tree name2)
/* Check that the promoted modes are the same. We don't want to
coalesce if the promoted modes would be different. Only
PARM_DECLs and RESULT_DECLs have different promotion rules,
- so skip the test if we both are variables or anonymous
- SSA_NAMEs. */
+ so skip the test if both are variables, or both are anonymous
+ SSA_NAMEs. Now, if a parm or result has BLKmode, do not
+ coalesce its SSA versions with those of any other variables,
+ because it may be passed by reference. */
return ((!var1 || VAR_P (var1)) && (!var2 || VAR_P (var2)))
- || promote_ssa_mode (name1, NULL) == promote_ssa_mode (name2, NULL);
+ || (/* The case var1 == var2 is already covered above. */
+ !parm_maybe_byref_p (var1)
+ && !parm_maybe_byref_p (var2)
+ && promote_ssa_mode (name1, NULL) == promote_ssa_mode (name2, NULL));
}
/* If the types are not the same, check for a canonical type match. This
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a change to branch aoliva/pr64164
in repository gcc.
discards cf3587d try special handlling of byref parms
new 3672f75 try special handlling of byref parms
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (cf3587d)
\
N -- N -- N refs/heads/aoliva/pr64164 (3672f75)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omits" are not gone; other references still
refer to them. Any revisions marked "discards" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
gcc/cfgexpand.c | 21 +++++++++++++++------
gcc/function.c | 4 ++--
2 files changed, 17 insertions(+), 8 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a change to branch trunk
in repository gcc.
from 6ffea52 Daily bump.
new 68a98a7 Fix PR 66521
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
gcc/ChangeLog | 19 +++++++++
gcc/cp/ChangeLog | 8 ++++
gcc/cp/mangle.c | 8 ++++
gcc/vtable-verify.c | 92 +++++++++++++++++++++++++++++++++++++++--
gcc/vtable-verify.h | 5 +++
libvtv/ChangeLog | 11 +++++
libvtv/testsuite/Makefile.am | 16 +++----
libvtv/testsuite/Makefile.in | 14 ++++---
libvtv/testsuite/lib/libvtv.exp | 37 +++++++++++------
libvtv/vtv_malloc.cc | 2 +-
libvtv/vtv_rts.cc | 7 ++--
11 files changed, 186 insertions(+), 33 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a commit to branch aoliva/pr64164
in repository gcc.
The following commit(s) were added to refs/heads/aoliva/pr64164 by this push:
new cf3587d try special handlling of byref parms
cf3587d is described below
commit cf3587dd5bca46724986a36728bc267ef2261f9d
Author: Alexandre Oliva <aoliva(a)redhat.com>
Date: Sat Aug 1 22:04:17 2015 -0300
try special handlling of byref parms
for gcc/ChangeLog
PR middle-end/67034
* cfgexpand.c (parm_maybe_byref_p): New.
(expand_one_ssa_partition): Call it. Expand maybe-byref parms
with a placeholder for the mem addr.
(pass_expand::execute): Check that the placeholder was
replaced.
* function.c (assign_parm_setup_reg): Replace placeholder with
newly-created pseudo. Arrange for the pseudo to be
initialized from the incoming passed pointer. Don't copy the
BLKmode data, just check that it was a maybe_byref parm.
* cfgexpand.h (parm_maybe_byref_p): Declare.
* tree-ssa-coalesce.c: Include cfgexpand.h.
(gimple_can_coalesce_p): Do not coalesce maybe-byref parms
with SSA_NAMEs of other variables, or anonymous SSA_NAMEs.
---
gcc/cfgexpand.c | 24 ++++++++++++++++++++++-
gcc/cfgexpand.h | 1 +
gcc/function.c | 51 ++++++++++++++++++++++---------------------------
gcc/tree-ssa-coalesce.c | 12 +++++++++---
4 files changed, 56 insertions(+), 32 deletions(-)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 9577ad6d..96226fd 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -172,6 +172,23 @@ leader_merge (tree cur, tree next)
return cur;
}
+/* Return TRUE if VAR is a PARM_DECL or a RESULT_DECL of type BLKmode.
+ Such parameters are likely passed as a pointer to the value, rather
+ than as a value, and so we must not coalesce them, nor allocate
+ stack space for them before determining the calling conventions for
+ them. */
+
+bool
+parm_maybe_byref_p (tree var)
+{
+ if (!var || VAR_P (var))
+ return false;
+
+ gcc_assert (TREE_CODE (var) == PARM_DECL
+ || TREE_CODE (var) == RESULT_DECL);
+
+ return TYPE_MODE (TREE_TYPE (var)) == BLKmode;
+}
/* Return the RTL for the default SSA def of a PARM or RESULT, if
there is one. */
@@ -1315,7 +1332,9 @@ expand_one_ssa_partition (tree var)
if (!use_register_for_decl (var))
{
- if (defer_stack_allocation (var, true))
+ if (parm_maybe_byref_p (SSA_NAME_VAR (var)))
+ expand_one_stack_var_at (var, pc_rtx, 0, 0);
+ else if (defer_stack_allocation (var, true))
add_stack_var (var);
else
expand_one_stack_var_1 (var);
@@ -6187,6 +6206,9 @@ pass_expand::execute (function *fun)
gcc_assert (in);
rtx out = SA.partition_to_pseudo[part];
gcc_assert (in == out || rtx_equal_p (in, out));
+ /* Make sure we have adjusted the RTL for byref parms. */
+ gcc_assert (!parm_maybe_byref_p (var)
+ || !rtx_referenced_p (in, pc_rtx));
}
}
diff --git a/gcc/cfgexpand.h b/gcc/cfgexpand.h
index 602579d..987cf356 100644
--- a/gcc/cfgexpand.h
+++ b/gcc/cfgexpand.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
extern tree gimple_assign_rhs_to_tree (gimple);
extern HOST_WIDE_INT estimated_stack_frame_size (struct cgraph_node *);
+extern bool parm_maybe_byref_p (tree);
extern rtx get_rtl_for_parm_ssa_default_def (tree var);
diff --git a/gcc/function.c b/gcc/function.c
index 390b81e..458b4e0 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3103,24 +3103,34 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
= promote_function_mode (data->nominal_type, data->nominal_mode, &unsignedp,
TREE_TYPE (current_function_decl), 2);
- rtx from_expand = rtl_for_parm (all, parm);
+ rtx from_expand = parmreg = rtl_for_parm (all, parm);
- if (from_expand)
+ if (from_expand && !data->passed_pointer)
{
- parmreg = from_expand;
- if (!data->passed_pointer && GET_MODE (parmreg) != promoted_nominal_mode)
+ if (GET_MODE (parmreg) != promoted_nominal_mode)
parmreg = gen_lowpart (promoted_nominal_mode, parmreg);
}
- else
+ else if (!from_expand || parm_maybe_byref_p (parm))
{
parmreg = gen_reg_rtx (promoted_nominal_mode);
if (!DECL_ARTIFICIAL (parm))
mark_user_reg (parmreg);
+
+ if (from_expand)
+ {
+ gcc_assert (data->passed_pointer);
+ gcc_assert (GET_CODE (from_expand) == MEM
+ && GET_MODE (from_expand) == BLKmode
+ && XEXP (from_expand, 0) == pc_rtx);
+ XEXP (from_expand, 0) = parmreg;
+ }
}
/* If this was an item that we received a pointer to,
set DECL_RTL appropriately. */
- if (!from_expand && data->passed_pointer)
+ if (from_expand)
+ ;
+ else if (data->passed_pointer)
{
rtx x = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (data->passed_type)), parmreg);
set_mem_attributes (x, parm, 1);
@@ -3141,8 +3151,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
need_conversion = (data->nominal_mode != data->passed_mode
|| promoted_nominal_mode != data->promoted_mode);
- gcc_assert (!(need_conversion && data->passed_pointer));
- moved = from_expand && data->passed_pointer;
+ moved = false;
if (need_conversion
&& GET_MODE_CLASS (data->nominal_mode) == MODE_INT
@@ -3281,15 +3290,12 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
if (data->passed_pointer
&& (from_expand || TYPE_MODE (TREE_TYPE (parm)) != BLKmode))
{
- rtx src = DECL_RTL (parm);
-
/* We can't use nominal_mode, because it will have been set to
Pmode above. We must use the actual mode of the parm. */
if (from_expand)
{
+ parmreg = from_expand;
gcc_assert (GET_MODE (parmreg) == TYPE_MODE (TREE_TYPE (parm)));
- src = gen_rtx_MEM (GET_MODE (parmreg), validated_mem);
- set_mem_attributes (src, parm, 1);
}
else if (use_register_for_decl (parm))
{
@@ -3308,14 +3314,14 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tr [...]
set_mem_attributes (parmreg, parm, 1);
}
- if (GET_MODE (parmreg) != GET_MODE (src))
+ if (GET_MODE (parmreg) != GET_MODE (DECL_RTL (parm)))
{
- rtx tempreg = gen_reg_rtx (GET_MODE (src));
+ rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
int unsigned_p = TYPE_UNSIGNED (TREE_TYPE (parm));
push_to_sequence2 (all->first_conversion_insn,
all->last_conversion_insn);
- emit_move_insn (tempreg, src);
+ emit_move_insn (tempreg, DECL_RTL (parm));
tempreg = convert_to_mode (GET_MODE (parmreg), tempreg, unsigned_p);
emit_move_insn (parmreg, tempreg);
all->first_conversion_insn = get_insns ();
@@ -3325,20 +3331,9 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
did_conversion = true;
}
else if (GET_MODE (parmreg) == BLKmode)
- {
- push_to_sequence2 (all->first_conversion_insn,
- all->last_conversion_insn);
- gcc_assert (TREE_CODE (data->passed_type) == POINTER_TYPE);
- gcc_assert (TREE_TYPE (data->passed_type) == TREE_TYPE (parm));
- emit_block_move (parmreg, src,
- GEN_INT (int_size_in_bytes (TREE_TYPE (parm))),
- BLOCK_OP_NORMAL);;
- all->first_conversion_insn = get_insns ();
- all->last_conversion_insn = get_last_insn ();
- end_sequence ();
- }
+ gcc_assert (parm_maybe_byref_p (parm));
else
- emit_move_insn (parmreg, src);
+ emit_move_insn (parmreg, DECL_RTL (parm));
SET_DECL_RTL (parm, parmreg);
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index a622728..08ce72c 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-iterator.h"
#include "tree-ssa-live.h"
#include "tree-ssa-coalesce.h"
+#include "cfgexpand.h"
#include "explow.h"
#include "diagnostic-core.h"
@@ -1379,10 +1380,15 @@ gimple_can_coalesce_p (tree name1, tree name2)
/* Check that the promoted modes are the same. We don't want to
coalesce if the promoted modes would be different. Only
PARM_DECLs and RESULT_DECLs have different promotion rules,
- so skip the test if we both are variables or anonymous
- SSA_NAMEs. */
+ so skip the test if both are variables, or both are anonymous
+ SSA_NAMEs. Now, if a parm or result has BLKmode, do not
+ coalesce its SSA versions with those of any other variables,
+ because it may be passed by reference. */
return ((!var1 || VAR_P (var1)) && (!var2 || VAR_P (var2)))
- || promote_ssa_mode (name1, NULL) == promote_ssa_mode (name2, NULL);
+ || (/* The case var1 == var2 is already covered above. */
+ !parm_maybe_byref_p (var1)
+ && !parm_maybe_byref_p (var2)
+ && promote_ssa_mode (name1, NULL) == promote_ssa_mode (name2, NULL));
}
/* If the types are not the same, check for a canonical type match. This
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a change to branch trunk
in repository gcc.
from 814b1ca 2015-08-01 Paul Thomas <pault(a)gcc.gnu.org>
new 6ffea52 Daily bump.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
gcc/DATESTAMP | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
unknown user pushed a change to branch trunk
in repository gcc.
from 5955834 Allow non-overflow ops in reductions
new 814b1ca 2015-08-01 Paul Thomas <pault(a)gcc.gnu.org>
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
gcc/fortran/ChangeLog | 6 +++
gcc/fortran/trans-intrinsic.c | 2 +
gcc/testsuite/ChangeLog | 5 +++
gcc/testsuite/gfortran.dg/associated_target_6.f03 | 49 +++++++++++++++++++++++
4 files changed, 62 insertions(+)
create mode 100644 gcc/testsuite/gfortran.dg/associated_target_6.f03
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.