public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95189] New: memcmp being wrongly stripped (regression)
@ 2020-05-18 13:56 gcc at pkh dot me
  2020-05-19  6:28 ` [Bug middle-end/95189] [10/11 Regression] memcmp being wrongly stripped like strcmp rguenth at gcc dot gnu.org
                   ` (33 more replies)
  0 siblings, 34 replies; 35+ messages in thread
From: gcc at pkh dot me @ 2020-05-18 13:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189

            Bug ID: 95189
           Summary: memcmp being wrongly stripped (regression)
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at pkh dot me
  Target Milestone: ---

Given the following C code:

    % cat a.c
    #include <string.h>
    static const float z[1] = {0};
    int f(float x) { return memcmp(&x, z, sizeof(x)); }

GCC 10 generates this on x86-64:

    % gcc -Wall -O2 -c a.c && objdump -d -Mintel a.o

    a.o:     file format elf64-x86-64


    Disassembly of section .text:

    0000000000000000 <f>:
       0:       f3 0f 11 44 24 fc       movss  DWORD PTR [rsp-0x4],xmm0
       6:       0f b6 44 24 fc          movzx  eax,BYTE PTR [rsp-0x4]
       b:       c3                      ret

This doesn't happen if "= {0}" is removed from the z initialization (wtf?).
It also doesn't happen with -O1.

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2022-05-27  8:54 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 13:56 [Bug c/95189] New: memcmp being wrongly stripped (regression) gcc at pkh dot me
2020-05-19  6:28 ` [Bug middle-end/95189] [10/11 Regression] memcmp being wrongly stripped like strcmp rguenth at gcc dot gnu.org
2020-05-23 21:01 ` jakub at gcc dot gnu.org
2020-05-23 21:17 ` jakub at gcc dot gnu.org
2020-05-24 20:10 ` msebor at gcc dot gnu.org
2020-06-09 13:38 ` gcc at pkh dot me
2020-06-09 23:53 ` msebor at gcc dot gnu.org
2020-06-24 21:24 ` msebor at gcc dot gnu.org
2020-07-01  0:25 ` msebor at gcc dot gnu.org
2020-07-01 14:46 ` msebor at gcc dot gnu.org
2020-07-13 15:50 ` jerryfromearth at gmail dot com
2020-07-20 18:09 ` cvs-commit at gcc dot gnu.org
2020-07-20 18:10 ` [Bug middle-end/95189] [10 " msebor at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-08-16 20:26 ` [Bug middle-end/95189] [9/10 " pinskia at gcc dot gnu.org
2020-08-16 20:26 ` pinskia at gcc dot gnu.org
2020-09-03 22:37 ` amonakov at gcc dot gnu.org
2020-09-06 23:28 ` msebor at gcc dot gnu.org
2020-09-27 14:22 ` public at timruffing dot de
2020-10-05 23:41 ` luke-jr+gccbugs at utopios dot org
2020-10-06  5:47 ` amonakov at gcc dot gnu.org
2020-10-07 22:49 ` bugdal at aerifal dot cx
2020-10-08  4:31 ` luke-jr+gccbugs at utopios dot org
2020-10-08 18:38 ` cvs-commit at gcc dot gnu.org
2020-10-08 18:40 ` msebor at gcc dot gnu.org
2020-10-08 22:51 ` bugdal at aerifal dot cx
2020-10-09  0:12 ` luke-jr+gccbugs at utopios dot org
2020-10-09  2:26 ` bugdal at aerifal dot cx
2020-10-09 13:09 ` luke-jr+gccbugs at utopios dot org
2021-01-02  5:05 ` davmac at davmac dot org
2021-06-01  8:17 ` rguenth at gcc dot gnu.org
2021-06-24  1:13 ` bugdal at aerifal dot cx
2021-06-24  6:29 ` [Bug middle-end/95189] [9 " rguenth at gcc dot gnu.org
2022-03-17 19:47 ` msebor at gcc dot gnu.org
2022-05-27  8:54 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).