From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 28DCF385781A; Wed, 17 Mar 2021 08:44:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28DCF385781A From: "williambader at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99621] [8/9/10/11 Regression] Wrong code with -m32 -O1 -fcaller-saves -fexpensive-optimizations since g:058e97ecf33ad0dfd926b3876a4bcf59ac9556ff Date: Wed, 17 Mar 2021 08:44:43 +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: 11.0 X-Bugzilla-Keywords: ra X-Bugzilla-Severity: normal X-Bugzilla-Who: williambader at hotmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2021 08:44:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99621 --- Comment #8 from William Bader --- Created attachment 50404 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50404&action=3Dedit example program before creduce This is the example that I cut from a much larger module. The problematic a= rea is around the line `#if DBUG_FIX`. $ rm a.out ; gcc -Wall -O9 gcc-bug1-init.c ; a.out # ok in m64 len 4287, good $ rm a.out ; gcc -m32 -Wall -O9 gcc-bug1-init.c ; a.out # fails in m32 -O9 len 5167, expected bad $ rm a.out ; gcc -m32 -Wall -O0 gcc-bug1-init.c ; a.out # ok in m32 -O0 len 4287, good $ rm a.out ; gcc -m32 -Wall -O9 -DBUG_FIX=3D1 gcc-bug1-init.c gcc-bug1b.c ;= a.out # ok in m32 -O9 calling an empty function gcc-bug1-init.c: In function =E2=80=98find_ad_image_breaks=E2=80=99: gcc-bug1-init.c:756:4: warning: implicit declaration of function =E2=80=98g= cc_bug_fix=E2=80=99 [-Wimplicit-function-declaration] 756 | gcc_bug_fix(); | ^~~~~~~~~~~ len 4287, good $ cat gcc-bug1b.c=20 void gcc_bug_fix(void) { } $ rm a.out ; clang -m32 -Wall -O3 gcc-bug1-init.c ; a.out # ok in clang gcc-bug1-init.c:154:19: warning: illegal character encoding in string liter= al [-Winvalid-source-encoding] memcmp(buf, COREL_HEADER_STRING, COREL_HEADER_STRING_LEN) !=3D 0) { ^~~~~~~~~~~~~~~~~~~ gcc-bug1-init.c:130:30: note: expanded from macro 'COREL_HEADER_STRING' #define COREL_HEADER_STRING "" /* start of hea= der */ ^~~~~~~~~~~~~~~~ 1 warning generated. len 4287, good $ uname -a Linux laptop 5.10.22-100.fc32.x86_64 #1 SMP Tue Mar 9 17:40:24 UTC 2021 x86= _64 x86_64 x86_64 GNU/Linux $ gcc -v Using built-in specs. COLLECT_GCC=3D/usr/bin/gcc COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-redhat-linux/10/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=3Dc,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=3D/usr --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttp://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=3Dposix --enable-checking=3Drelease --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=3Dgnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=3Dnvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=3Dgeneric --with-arch_32=3Di686 --build=3Dx86_64-redhat-linux Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.1 20201125 (Red Hat 10.2.1-9) (GCC)=