From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8E4953858412; Thu, 23 Feb 2023 15:44:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E4953858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677167048; bh=exW/PeCLVnB1Q+HEKjKUw1mU+5dmHQAtTtOKlmWOTDc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LH59NH2ercp3vLdWv0SX6Bh2D6qNxqUwQ/BW2DgLxPhr3xevlTmRTu0W3GMjvx8rL 7uZ5WVWtX3mYpnOshl9wdmJ0scVdu7MnSZuuC+GxpE+2IhP/Xh6ej6VO5/Gn7IDr1O NZ7sW8J81NBjTgTgGTZd3ZBF9ZB/M63A/WRPQomw= From: "gjl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97276] A whole if-block is ignored by avr-gcc 9.3.0 Date: Thu, 23 Feb 2023 15:44:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97276 --- Comment #4 from Georg-Johann Lay --- Created attachment 54518 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54518&action=3Dedit pwn-i.c pre-compiled test case Ok, I found it and attached a cleaned-up version. IIUC correctly, the relevant options you are using to compile are: -O1 -mmcu=3Datxmega32a4 -g -ggdb -std=3Dgnu99 With these options (and with -fverbose-asm to easier navigate in asm) I cou= ld not reproduce the problem with avr-gcc v8.5. The respective part of .s rea= ds (I dropped -g for legibility, but with -g it's same): ; pwm-i.c:287: if (last_brightness < 181 && j >=3D 181) ldi r30,lo8(-76) ; , ; 320 [c=3D4 l=3D1] movqi_insn/1 cp r30,r11 ; , last_brightness ; 193 [c=3D4 l=3D= 1]=20 cmpqi3/1 brsh .+2 ; ; 194 [c=3D16 l=3D2] branch rjmp .L16 ;=20 ; pwm-i.c:287: if (last_brightness < 181 && j >=3D 181) cpi r22,lo8(-75) ; iftmp.3_5, ; 196 [c=3D4 l=3D1] cmpq= i3/2 brsh .+2 ; ; 197 [c=3D16 l=3D2] branch rjmp .L16 ;=20 ; pwm-i.c:289: slot->top =3D 0xfe00; st X+,r8 ; tmp226 ; 200 [c=3D4 l=3D3] *movhi/3 st X,r9 ; tmp226 sbiw r26,1 ; pwm-i.c:290: slot->mask =3D ~mask; movw r30,r24 ; tmp200, mask ; 321 [c=3D4 l=3D1] *mov= hi/0 com r30 ; tmp200 ; 201 [c=3D8 l=3D2] one_cmplhi2 com r31 ; tmp200 ; pwm-i.c:290: slot->mask =3D ~mask; adiw r26,2 ; slot_172->mask ; 202 [c=3D4 l=3D4] *mov= hi/3 st X+,r30 ; tmp200 st X,r31 ; tmp200 sbiw r26,2+1 ; slot_172->mask ; pwm-i.c:291: ++slot; adiw r26,4 ; slot, ; 203 [c=3D4 l=3D1] addhi3_clobb= er/0=