This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Unchecked call to init_symbolic_number
- From: "Thomas Preud'homme" <thomas dot preudhomme at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 10 Jun 2014 10:11:06 +0800
- Subject: [PATCH] Unchecked call to init_symbolic_number
- Authentication-results: sourceware.org; auth=none
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;