------- Comment #8 from pinskia at gcc dot gnu dot org 2006-04-12 01:14 ------- GRRRRRRR.
This is partly caused by the patch for PR 23669. (In reply to comment #7) > > I disagree. Could you give an explicit example? > Sorry, my mistake, I should not have suggested this testcase: this > optimization > is indeed fine (yet GCC 4.1 does not apply it). The following testcase is not > fine though (directly derived from the original testcase): > int f(int a, int b) { return (-1 - a) / (-b); } > GCC 4.2 generates the division "(a + 1) / b". This optimization is wrong when > "a" contains the biggest positive integer. This is undefined only if b is known to be negative otherwise it is defined. Note I cannot patch anything right now so if someone wants to revert my patch that is fine. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu dot | |org OtherBugsDependingO| |23669 nThis| | Known to work|4.1.0 4.0.3 | Target Milestone|--- |4.2.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27116