Bug 394271 - gcc optimization error for neg number * abs() [extract_muldiv]
Summary: gcc optimization error for neg number * abs() [extract_muldiv]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc
Version: 4.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-21 15:18 UTC by Jan Iven
Modified: 2018-10-20 00:23 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-18 20:33:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 34130 0 None None None Never
Red Hat Product Errata RHBA-2009:1016 0 normal SHIPPED_LIVE gcc bug fix update 2009-05-18 14:23:43 UTC

Description Jan Iven 2007-11-21 15:18:35 UTC
As reported on http://linux.solidot.org/article.pl?sid=07/11/19/0512218&from=rss
and http://lkml.org/lkml/2007/11/19/493, the following test program triggers 
an optimization bug in gcc for the builtin abs() function:

int main () {
                int i=2;
                if( -10*abs (i-1) == 10*abs(i-1) )
                                printf ("OMG,-10==10 in linux!\n");
                else
                                printf ("nothing special here\n");
}


Verified with RHEL4 (gcc-3.4.6-8), RHEL5 (gcc-4.1.2-14.el5), F8 (gcc-4.1.2-33).
Upstream patch at
http://www.nabble.com/-PATCH--Fix-PR34130,-extract_muldiv-broken-t4826688.html

Comment 2 RHEL Program Management 2008-09-05 17:21:26 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 3 Jakub Jelinek 2008-09-30 16:22:11 UTC
Already in gcc4-4.1.2-42.EL4 (and in RHEL5), will backport to gcc-3.4.6-RH too.

Comment 11 errata-xmlrpc 2009-05-18 20:33:43 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1016.html


Note You need to log in before you can comment on or make changes to this bug.