This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Avoid uninitialized warning in i386.c
- From: Marek Polacek <polacek at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Dec 2013 14:39:44 +0100
- Subject: [PATCH] Avoid uninitialized warning in i386.c
- Authentication-results: sourceware.org; auth=none
Bootstrap with -fsanitize=undefined revealed that the alg variable
may be used uninitialized. Or at least gcc thinks so. This patch
initializes it to 0.
Regtested/bootstrapped on x86_64-linux, ok for trunk?
2013-12-18 Marek Polacek <polacek@redhat.com>
* config/i386/i386.c (ix86_parse_stringop_strategy_string): Initialize
alg to 0.
--- gcc/config/i386/i386.c.mp 2013-12-18 13:38:21.908138307 +0100
+++ gcc/config/i386/i386.c 2013-12-18 13:38:41.417214628 +0100
@@ -2856,7 +2856,7 @@ ix86_parse_stringop_strategy_string (cha
do
{
int maxs;
- stringop_alg alg;
+ stringop_alg alg = (stringop_alg) 0;
char alg_name[128];
char align[16];
next_range_str = strchr (curr_range_str, ',');
Marek