This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix condition in ira-color.c and lra-spills.c (PR c/61271)


On 2014-08-22 10:51 AM, Marek Polacek wrote:
Bootstrapped/regtested on x86_64-linux, ok for trunk?


Ok. Thanks, Marek.

2014-08-22  Marek Polacek  <polacek@redhat.com>

	PR c/61271
	* ira-color.c (coalesced_pseudo_reg_slot_compare): Wrap LHS of
	a comparison in parens.
	* lra-spills.c (pseudo_reg_slot_compare): Wrap LHS of a comparison
	in parens.

diff --git gcc/ira-color.c gcc/ira-color.c
index 36c3c87..e2ea359 100644
--- gcc/ira-color.c
+++ gcc/ira-color.c
@@ -3850,7 +3850,7 @@ coalesced_pseudo_reg_slot_compare (const void *v1p, const void *v2p)
    slot_num2 = -ALLOCNO_HARD_REGNO (a2);
    if ((diff = slot_num1 - slot_num2) != 0)
      return (frame_pointer_needed
-	    || !FRAME_GROWS_DOWNWARD == STACK_GROWS_DOWNWARD ? diff : -diff);
+	    || (!FRAME_GROWS_DOWNWARD) == STACK_GROWS_DOWNWARD ? diff : -diff);
    total_size1 = MAX (PSEUDO_REGNO_BYTES (regno1),
  		     regno_max_ref_width[regno1]);
    total_size2 = MAX (PSEUDO_REGNO_BYTES (regno2),
diff --git gcc/lra-spills.c gcc/lra-spills.c
index 50f63fc..38a81e6 100644
--- gcc/lra-spills.c
+++ gcc/lra-spills.c
@@ -237,7 +237,7 @@ pseudo_reg_slot_compare (const void *v1p, const void *v2p)
    slot_num2 = pseudo_slots[regno2].slot_num;
    if ((diff = slot_num1 - slot_num2) != 0)
      return (frame_pointer_needed
-	    || !FRAME_GROWS_DOWNWARD == STACK_GROWS_DOWNWARD ? diff : -diff);
+	    || (!FRAME_GROWS_DOWNWARD) == STACK_GROWS_DOWNWARD ? diff : -diff);
    total_size1 = GET_MODE_SIZE (lra_reg_info[regno1].biggest_mode);
    total_size2 = GET_MODE_SIZE (lra_reg_info[regno2].biggest_mode);
    if ((diff = total_size2 - total_size1) != 0)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]