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

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



* Frans Pop <elendil@planet.nl> [2007-11-21 17:47]:
> 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).

Sounds like something Lucas (CCed) could do.

> --- 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))

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: