[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gcc compilation error with abs() affects sarge, etch, lenny, sid



On Wednesday 21 November 2007, Henrique de Moraes Holschuh wrote:
> On Tue, 20 Nov 2007, Frans Pop wrote:
> > A patch is available, but the question facing Debian is: should we do a
> > scan of the archive to see if and which binary packages are affected?
>
> Given the sort of insiduous, nightmarish to debug kind of bug this thing
> could cause, I'd say that yes, we should.  I don't expect it is a very
> common problem, but one can't be sure without looking for it.

The most effective/efficient way to do this may be an archive rebuild with
a modified gcc that emits a warning if this case is hit and then check build
logs for the warning.

Something like the patch below (stolen from the thread on linux-kernel).

--- trunk/gcc/fold-const.c      2007/11/17 13:46:53     130257
+++ trunk/gcc/fold-const.c      2007/11/17 14:22:42     130258
@@ -6095,6 +6095,9 @@
              }
            break;
          }
+      /* If the constant is negative, we cannot simplify this.  */
+      if (tree_int_cst_sgn (c) == -1)
+        { warning(0, "Unpatched gcc miscompiles this"); break; }
        /* FALLTHROUGH */
      case NEGATE_EXPR:
        if ((t1 = extract_muldiv (op0, c, code, wide_type, strict_overflow_p))

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: