summaryrefslogtreecommitdiff
path: root/gcc/fixed-value.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-03-02 13:42:05 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-03-02 13:42:05 +0000
commite80facb4afaaa4d42b17f6970e9738f7c293f522 (patch)
tree1ae9c4a7112cdf29926e13b25e432f7a93f48b81 /gcc/fixed-value.c
parentf03e92172a78fbb7beab293ced88b161b2cfb4c5 (diff)
re PR tree-optimization/79345 (passing yet-uninitialized member as argument to base class constructor should warn (-Wunitialized))
2017-03-02 Richard Biener <rguenther@suse.de> PR tree-optimization/79345 PR c++/42000 * tree-ssa-alias.c (walk_aliased_vdefs_1): Take a limit param and abort the walk, returning -1 if it is hit. (walk_aliased_vdefs): Take a limit param and pass it on. * tree-ssa-alias.h (walk_aliased_vdefs): Add a limit param, defaulting to 0 and return a signed int. * tree-ssa-uninit.c (struct check_defs_data): New struct. (check_defs): New helper. (warn_uninitialized_vars): Use walk_aliased_vdefs to warn about uninitialized memory. * fixed-value.c (fixed_from_string): Use ulow/uhigh to avoid bogus uninitialized warning. (fixed_convert_from_real): Likewise. * g++.dg/warn/Wuninitialized-7.C: New testcase. * c-c++-common/ubsan/bounds-2.c: Add -Wno-uninitialized. * gcc.dg/uninit-pr19430-2.c: Add expected warning. From-SVN: r245840
Diffstat (limited to 'gcc/fixed-value.c')
-rw-r--r--gcc/fixed-value.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c
index 810f7014d8b..d9489a3a576 100644
--- a/gcc/fixed-value.c
+++ b/gcc/fixed-value.c
@@ -130,8 +130,8 @@ fixed_from_string (FIXED_VALUE_TYPE *f, const char *str, machine_mode mode)
real_arithmetic (&fixed_value, MULT_EXPR, &real_value, &base_value);
wide_int w = real_to_integer (&fixed_value, &fail,
GET_MODE_PRECISION (mode));
- f->data.low = w.elt (0);
- f->data.high = w.elt (1);
+ f->data.low = w.ulow ();
+ f->data.high = w.uhigh ();
if (temp == FIXED_MAX_EPS && ALL_FRACT_MODE_P (f->mode))
{
@@ -1049,8 +1049,8 @@ fixed_convert_from_real (FIXED_VALUE_TYPE *f, machine_mode mode,
wide_int w = real_to_integer (&fixed_value, &fail,
GET_MODE_PRECISION (mode));
- f->data.low = w.elt (0);
- f->data.high = w.elt (1);
+ f->data.low = w.ulow ();
+ f->data.high = w.uhigh ();
temp = check_real_for_fixed_mode (&real_value, mode);
if (temp == FIXED_UNDERFLOW) /* Minimum. */
{