Bug 28509

Summary: gcc-2.96-75 miscompiles rpm
Product: [Retired] Red Hat Linux Reporter: Jeff Johnson <jbj>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: msw, rth
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-22 09:38:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Debugging patch to display miscompilation. none

Description Jeff Johnson 2001-02-20 22:00:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.16-24 alpha)


gcc-2.96-75 (and most versions since Red Hat 7.0) has been miscompiling
rpm.

Reproducible: Always
Steps to Reproduce:
1. Apply patch to rpm-4.0.2-7x.src.rpm, build and install
2. Attempt to do "rpm --checksig signed package here"
3. Examine debugging output., the short in lead.signature_type has several
values, mostly wrong.

Comment 1 Jeff Johnson 2001-02-20 22:03:07 UTC
Created attachment 10580 [details]
Debugging patch to display miscompilation.

Comment 2 Jakub Jelinek 2001-02-20 22:48:35 UTC
I get with both -O2 and -O0 build:
*** readLead: signature_type 5
*** rpmCheckSig, after readLead: lead.signature_type 5
*** rpmCheckSig, before rpmReadSignature: l->signature_type 25441
*** rpmReadSignature: sigType 25441
error: /mnt/redhat/comps/dist/7.0.x/i386/openssh-2.3.0p1-4.i386.rpm: rpmReadSignature failed
What is the expected output and why you think it is actually
a miscompilation?
I'll read it carefully tomorrow.

Comment 3 Jakub Jelinek 2001-02-21 17:34:21 UTC
I had to #undef ALPHA_LOSSAGE because otherwise the fault is in rpm source -
with ALPHA_LOSSAGE defined you rpmLead into one rpmlead structure and read from
a malloced one which was never initialized.
I've managed to minimize this into small testcase, am checking CVS gcc ATM.

Comment 4 Jakub Jelinek 2001-02-22 09:38:24 UTC
Fixed by
2000-08-11  Richard Henderson  <rth>

        * combine.c (simplify_shift_const): Obey SHIFT_COUNT_TRUNCATED.
which will be included in gcc-2.96-76.
(and you please remove ALPHA_LOSSAGE next time you build rpm).