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.
Created attachment 10580 [details] Debugging patch to display miscompilation.
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.
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.
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).