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] Unchecked call to init_symbolic_number


When doing a bootstrap on x86_64-linux-gnu to test a patch I'm writing,
I encountered a failure that turned out to be due to not checking the
return value of init_symbolic_number in find_bswap_or_nop_load
(tree-ssa-math-opts.c). The following patch fixes that and I commited
it as obvious as per GCC write access policies.

ChangeLog:

2014-06-09  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* tree-ssa-math-opts.c (find_bswap_or_nop_load): Check return value of
	init_symbolic_number ().


diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index a928ad9..1f011a6 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1784,7 +1784,8 @@ find_bswap_or_nop_load (gimple stmt, tree ref, struct symbolic_number *n)
   if (bitsize % BITS_PER_UNIT)
     return false;
 
-  init_symbolic_number (n, ref);
+  if (!init_symbolic_number (n, ref))
+    return false;
   n->base_addr = base_addr;
   n->offset = offset;
   n->bytepos = bitpos / BITS_PER_UNIT;



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