From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 601B13858409; Tue, 14 Dec 2021 15:33:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 601B13858409 From: "jengelh at inai dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/103710] New: Missed optimization: common bit prefix/suffixes of multiple values Date: Tue, 14 Dec 2021 15:33:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jengelh at inai dot de 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Tue, 14 Dec 2021 15:33:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103710 Bug ID: 103710 Summary: Missed optimization: common bit prefix/suffixes of multiple values Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jengelh at inai dot de Target Milestone: --- Environment: =C2=BB ./xgcc -v ... Reading specs from /home/jengelh/repos/gcc/host-x86_64-pc-linux-gnu/gcc/spe= cs COLLECT_GCC=3D./xgcc Target: x86_64-pc-linux-gnu Configured with: ./configure --enable-languages=3Dc,c++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 20211214 (experimental) (GCC)=20 COLLECT_GCC_OPTIONS=3D'-v' '-B' '/home/jengelh/repos/gcc/host-x86_64-pc-linux-gnu/gcc' '-D' 'noexcept=3D' '= -c' '-O2' '-mtune=3Dgeneric' '-march=3Dx86-64' GNU C17 (GCC) version 12.0.0 20211214 (experimental) (x86_64-pc-linux-gnu) compiled by GNU C version 11.2.1 20211124 [revision 7510c23c1ec53aa4a62705f0384079661342ff7b], GMP version 6.2.1, MPFR version 4.1.0-p7, MPC version 1.2.1, isl version none GGC heuristics: --param ggc-min-expand=3D30 --param ggc-min-heapsize=3D4096 Input: attachment #0 Observed output: $ ./xgcc -B. -x c++ -c -O2 t.cpp && readelf -a t.o | grep fct 3: 0000000000000000 54 FUNC GLOBAL DEFAULT 1 _Z4fct0j 4: 0000000000000040 54 FUNC GLOBAL DEFAULT 1 _Z4fct4j 5: 0000000000000080 54 FUNC GLOBAL DEFAULT 1 _Z4fct8j 6: 00000000000000c0 54 FUNC GLOBAL DEFAULT 1 _Z5fct12j 7: 0000000000000100 54 FUNC GLOBAL DEFAULT 1 _Z5fct16j 8: 0000000000000140 54 FUNC GLOBAL DEFAULT 1 _Z5fct20j 9: 0000000000000180 38 FUNC GLOBAL DEFAULT 1 _Z5fct24j 10: 00000000000001b0 32 FUNC GLOBAL DEFAULT 1 _Z5fct25j 11: 00000000000001d0 35 FUNC GLOBAL DEFAULT 1 _Z6fctmaxj Desired output: Provided I made no mistake in the equivalency of all fct functions, the fct functions should, preferably, all compile to the same machine code.=