https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92397

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-11-06
                 CC|                            |msebor at gcc dot gnu.org
          Component|c                           |bootstrap
             Blocks|                            |56456, 86656
     Ever confirmed|0                           |1

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The excessive sanitizer instrumentation is known to cause trouble for
middle-end warnings like -Warray-bounds (see for example pr91146, pr91707,
pr87884, pr84863, pr81601, and others).  The sanitized VRP dump for
real_roundeven shows the out-of-bounds indices:

  <bb 2> [local count: 1073741823]:
  retval.467_13 = is_halfway_below (x_11(D));
  if (retval.467_13 != 0)
    goto <bb 3>; [67.00%]
  else
    goto <bb 9>; [33.00%]

  <bb 3> [local count: 719407020]:
  .UBSAN_NULL (x_11(D), 3B, 8);
  _1 = BIT_FIELD_REF <*x_11(D), 32, 0>;
  _2 = _1 & 4294967232;
  if (_2 == 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 4> [local count: 359703513]:
  .UBSAN_NULL (x_11(D), 2B, 8);
  .UBSAN_NULL (r_14(D), 1B, 8);
  .UBSAN_NULL (x_11(D), 0B, 8);
  _23 = __builtin_object_size (r_14(D), 0);
  GIMPLE_NOP
  _24 = __builtin_object_size (x_11(D), 0);
  GIMPLE_NOP
  *r_14(D) = *x_11(D);
  .UBSAN_NULL (r_14(D), 3B, 8);
  _48 = __builtin_object_size (r_14(D), 0);
  _49 = &r_14(D)->sig[0];
  _56 = (unsigned long) _49;
  _57 = (unsigned long) r_14(D);
  _58 = _56 - _57;
  _60 = _58 + 8;
  GIMPLE_NOP
  .UBSAN_PTR (r_14(D), 8);
  r_14(D)->sig[0] = 0;
  .UBSAN_NULL (r_14(D), 3B, 8);
  _92 = __builtin_object_size (r_14(D), 0);
  _93 = &r_14(D)->sig[1];
  _94 = (unsigned long) _93;
  _96 = _94 - _57;
  _97 = _96 + 8;
  GIMPLE_NOP
  .UBSAN_PTR (r_14(D), 16);
  r_14(D)->sig[1] = 0;
  .UBSAN_NULL (r_14(D), 3B, 8);
  _108 = __builtin_object_size (r_14(D), 0);
  _109 = &r_14(D)->sig[2];
  _110 = (unsigned long) _109;
  _112 = _110 - _57;
  _113 = _112 + 8;
  GIMPLE_NOP
  .UBSAN_PTR (r_14(D), 24);
  r_14(D)->sig[2] = 0;
  .UBSAN_NULL (r_14(D), 3B, 8);
  _50 = __builtin_object_size (r_14(D), 0);
  _51 = &r_14(D)->sig[3];                    <<< out of bounds
  _52 = (unsigned long) _51;
  _54 = _52 - _57;
  _55 = _54 + 8;
  GIMPLE_NOP
  .UBSAN_PTR (r_14(D), 32);
  _59 = r_14(D)->sig[3];                     <<< out of bounds
  .UBSAN_NULL (r_14(D), 3B, 8);
  _61 = __builtin_object_size (r_14(D), 0);
  GIMPLE_NOP
  .UBSAN_PTR (r_14(D), 32);
  goto <bb 7>; [100.00%]


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
[Bug 56456] [meta-bug] bogus/missing -Warray-bounds
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86656
[Bug 86656] [meta-bug] Issues found with -fsanitize=address

Reply via email to