Bug 63130 - gcc-2.96-109 miscompiles mysql with optimized db3
gcc-2.96-109 miscompiles mysql with optimized db3
Status: CLOSED RAWHIDE
Product: Red Hat Public Beta
Classification: Retired
Component: gcc (Show other bugs)
skipjack-beta2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-10 09:28 EDT by franz.sirl-kernel
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-10 09:31:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
loop bugfix (1.82 KB, patch)
2002-04-10 09:31 EDT, franz.sirl-kernel
no flags Details | Diff

  None (edit)
Description franz.sirl-kernel 2002-04-10 09:28:43 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9+)
Gecko/20020409

Description of problem:
If mysql is fixed like described in 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=62718 (or like in the patch
below) the mysql testsuite will no longer pass. That happens because a loop
patchset is missing from gcc-2.96-109 that went into gcc-3.0.3 and later:

2001-12-01  Olivier Hainque <hainque@act-europe.fr>

        * unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL
        while scanning for multiple back edges.

2001-10-11  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

        * unroll.c (loop_iterations): Fixup last patch.

2001-10-10  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

        PR c++/4512
        * unroll.c (loop_iterations): Ignore insns generated by loop
        unrolling.

If I apply this patch (see the attachment for PR 62718) and rebuild
gcc-2.96-109, it is able to compile a working mysql, even if the db3 package
included in mysql is built with optimization.


Version-Release number of selected component (if applicable):
gcc-2.96-109

How reproducible:
Always

Steps to Reproduce:
1. Apply this patch to mysql-3.23.49:
--- mysql-3.23.49/bdb/dist/configure~   Thu Feb 14 18:30:44 2002
+++ mysql-3.23.49/bdb/dist/configure    Wed Apr 10 14:01:41 2002
@@ -998,8 +998,7 @@
 irix*)    optimize_def="-O2"
           CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";;
 linux*)           optimize_def="-O2"
-          CFLAGS="-D_GNU_SOURCE"
-          CPPFLAGS="-D_REENTRANT $CPPFLAGS";;
+          CPPFLAGS="-D_GNU_SOURCE -D_REENTRANT $CPPFLAGS";;
 mpeix*)           CPPFLAGS="-D_POSIX_SOURCE -D_SOCKET_SOURCE $CPPFLAGS"
           LIBS="-lsocket -lsvipc $LIBS";;
 osf*)     CPPFLAGS="-D_REENTRANT $CPPFLAGS";;

2. build it with unpatched gcc-2.96-109
3.
	

Actual Results:  The tests will fail like this:
 TEST                         USER   SYSTEM  ELAPSED        RESULT
------------------------------------------------------------------------
alias                         0.07     0.08     0.16       [ pass ]
alter_table                   0.01     0.03     0.08       [ pass ]
analyse                       0.00     0.04     0.05       [ pass ]
auto_increment                0.02     0.03     0.07       [ pass ]
backup                        0.02     0.04     0.16       [ pass ]
bdb-crash                     0.05     0.00     0.54       [ pass ]
bdb-deadlock                  0.04     0.01     0.50       [ pass ]
bdb                           ....     ....     ....       [ fail ]

   >> Error at line 129: query 'insert into t1 values (4)' failed: 1062:
Duplicate entry '4' for key 1 <<
Aborting. To continue, re-run with '--force'.



Expected Results:  All tests should pass.


Additional info: Most probably this compiler bug affects the standalone db3/db3x
packages too.
Comment 1 franz.sirl-kernel 2002-04-10 09:31:19 EDT
Created attachment 53084 [details]
loop bugfix
Comment 2 Jakub Jelinek 2002-04-15 03:40:36 EDT
Patchset added to gcc-2.96-110.

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