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]

[PATCH, PR 64192] Add forgotten conversion from bits to bytes


Hi,

at some point I lost an important division of bit offset by
BITS_PER_UNIT in my alignment IPA-CP propagation patch. That lead to a
few failures on i686 reported as PR 64192.

This patch adds it together with a slight improvement of the guarding
check which I suppose will never trigger but it does ensure the
division will never loose information.

I consider this change obvious and would really like to commit it
before I leave for the weekend, so I will do so after it finishes
bootstrapping and testing on i686.  It has already passed bootstrap
and testing on x86_64-linux.

Thanks,

Martin


2014-12-05  Martin Jambor  <mjambor@suse.cz>

	PR ipa/64192
	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Convert alignment
	from bits to bytes after checking they are byte-aligned.

Index: src/gcc/ipa-prop.c
===================================================================
--- src.orig/gcc/ipa-prop.c
+++ src/gcc/ipa-prop.c
@@ -1739,10 +1739,11 @@ ipa_compute_jump_functions_for_edge (str
 	  unsigned align;
 
 	  if (get_pointer_alignment_1 (arg, &align, &hwi_bitpos)
-	      && align > BITS_PER_UNIT)
+	      && align % BITS_PER_UNIT == 0
+	      && hwi_bitpos % BITS_PER_UNIT == 0)
 	    {
 	      jfunc->alignment.known = true;
-	      jfunc->alignment.align = align;
+	      jfunc->alignment.align = align / BITS_PER_UNIT;
 	      jfunc->alignment.misalign = hwi_bitpos / BITS_PER_UNIT;
 	    }
 	  else


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