Bug#1135526: Possible miscompilation at -O2

Matthias Klose <[email protected]> Sun, 3 May 2026 06:38:13 +0200
Newsgroups gmane.linux.debian.devel.gcc
Message-ID <62910a1e-9082-4e51-8e1b-e23376a35aaa__12822.1578592033$1777783178$gmane$org@debian.org>
On 5/3/26 02:19, David Bremner wrote:
> David Bremner <[email protected]> writes:
> 
>>
>> Element 0 of reply_to_map gets field get_header initialized properly
>> with O1 but set to 0x0 at level O2. The latter is of course fatal
>> when the code just below tries to call through this table.
>> The other elements of the table look OK.
>>
>>      struct {
>> 	InternetAddressList * (*get_header)(GMimeMessage *message);
>> 	GMimeAddressType recipient_type;
>>      } reply_to_map[] = {
>> 	{ get_sender,   GMIME_ADDRESS_TYPE_TO },
>> 	{ get_to,       GMIME_ADDRESS_TYPE_TO },
>> 	{ get_cc,       GMIME_ADDRESS_TYPE_CC },
>> 	{ get_bcc,      GMIME_ADDRESS_TYPE_BCC },
>>      };
>>
> 
> I learned that declaring this array as static const seems to fix the
> initialization, although I'm not really sure how to interpret that.

just for my understanding: -16 (20260321) doesn't show this behavior, 
but -17 (20260423) does?  Do you have a test case smaller than building 
the whoole notmuch package?

Probably needs bisecting the upstream commits (git-updates.diff) to find 
the offending patch.